Add test helpers for Open API test target

This commit is contained in:
Mathew Polzin
2019-01-14 21:18:49 -08:00
parent 9e6e713ad2
commit a9e1e49a79
2 changed files with 31 additions and 0 deletions
@@ -0,0 +1,14 @@
//
// EntityTestTypes.swift
// JSONAPITests
//
// Created by Mathew Polzin on 11/15/18.
//
import JSONAPI
public typealias Entity<Description: JSONAPI.EntityDescription, Meta: JSONAPI.Meta, Links: JSONAPI.Links> = JSONAPI.Entity<Description, Meta, Links, String>
public typealias BasicEntity<Description: JSONAPI.EntityDescription> = Entity<Description, NoMetadata, NoLinks>
public typealias NewEntity<Description: JSONAPI.EntityDescription, Meta: JSONAPI.Meta, Links: JSONAPI.Links> = JSONAPI.Entity<Description, Meta, Links, Unidentified>
@@ -0,0 +1,17 @@
//
// String+CreatableRawIdType.swift
// JSONAPITests
//
// Created by Mathew Polzin on 11/12/18.
//
import JSONAPI
private var uniqueStringCounter = 0
extension String: CreatableRawIdType {
public static func unique() -> String {
uniqueStringCounter += 1
return String(uniqueStringCounter)
}
}