From a9e1e49a79f06f587ca215d1cb7b63d89e177bb0 Mon Sep 17 00:00:00 2001 From: Mathew Polzin Date: Mon, 14 Jan 2019 21:18:49 -0800 Subject: [PATCH] Add test helpers for Open API test target --- .../Test Helpers/EntityTestTypes.swift | 14 ++++++++++++++ .../String+CreatableRawIdType.swift | 17 +++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 Tests/JSONAPIOpenAPITests/Test Helpers/EntityTestTypes.swift create mode 100644 Tests/JSONAPIOpenAPITests/Test Helpers/String+CreatableRawIdType.swift diff --git a/Tests/JSONAPIOpenAPITests/Test Helpers/EntityTestTypes.swift b/Tests/JSONAPIOpenAPITests/Test Helpers/EntityTestTypes.swift new file mode 100644 index 0000000..23e6b7d --- /dev/null +++ b/Tests/JSONAPIOpenAPITests/Test Helpers/EntityTestTypes.swift @@ -0,0 +1,14 @@ +// +// EntityTestTypes.swift +// JSONAPITests +// +// Created by Mathew Polzin on 11/15/18. +// + +import JSONAPI + +public typealias Entity = JSONAPI.Entity + +public typealias BasicEntity = Entity + +public typealias NewEntity = JSONAPI.Entity diff --git a/Tests/JSONAPIOpenAPITests/Test Helpers/String+CreatableRawIdType.swift b/Tests/JSONAPIOpenAPITests/Test Helpers/String+CreatableRawIdType.swift new file mode 100644 index 0000000..dd3c8f7 --- /dev/null +++ b/Tests/JSONAPIOpenAPITests/Test Helpers/String+CreatableRawIdType.swift @@ -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) + } +}