diff --git a/README.md b/README.md index cf19926..a97923f 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ To create an Xcode project for JSONAPI, run ### Running the Playground To run the included Playground files, create an Xcode project using Swift Package Manager, then create an Xcode Workspace in the root of the repository and add both the generated Xcode project and the playground to the Workspace. -Note that Playground support for importing non-system Frameworks is still a bit touchy as of Swift 4.2. Sometimes building, cleaning and building, or commenting out and then uncommenting import statements (especially in the Entities.swift Playground Source file) can get things working for me when I am getting an error about JSONAPI not being found. +Note that Playground support for importing non-system Frameworks is still a bit touchy as of Swift 4.2. Sometimes building, cleaning and building, or commenting out and then uncommenting import statements (especially in the Entities.swift Playground Source file) can get things working for me when I am getting an error about `JSONAPI` not being found. ## Project Status diff --git a/Tests/JSONAPITests/XCTestManifests.swift b/Tests/JSONAPITests/XCTestManifests.swift index 5204df6..532a83f 100644 --- a/Tests/JSONAPITests/XCTestManifests.swift +++ b/Tests/JSONAPITests/XCTestManifests.swift @@ -1,5 +1,15 @@ import XCTest +extension APIDescriptionTests { + static let __allTests = [ + ("test_empty", test_empty), + ("test_failsMissingMeta", test_failsMissingMeta), + ("test_WithMeta", test_WithMeta), + ("test_WithVersion", test_WithVersion), + ("test_WithVersionAndMeta", test_WithVersionAndMeta), + ] +} + extension AttributeTests { static let __allTests = [ ("test_AttributeIsTransformedAttribute", test_AttributeIsTransformedAttribute), @@ -41,54 +51,98 @@ extension ComputedPropertiesTests { extension DocumentTests { static let __allTests = [ + ("test_errorDocumentFailsWithNoAPIDescription", test_errorDocumentFailsWithNoAPIDescription), ("test_errorDocumentNoMeta", test_errorDocumentNoMeta), ("test_errorDocumentNoMeta_encode", test_errorDocumentNoMeta_encode), + ("test_errorDocumentNoMetaWithAPIDescription", test_errorDocumentNoMetaWithAPIDescription), + ("test_errorDocumentNoMetaWithAPIDescription_encode", test_errorDocumentNoMetaWithAPIDescription_encode), ("test_manyDocumentNoIncludes", test_manyDocumentNoIncludes), ("test_manyDocumentNoIncludes_encode", test_manyDocumentNoIncludes_encode), + ("test_manyDocumentNoIncludesWithAPIDescription", test_manyDocumentNoIncludesWithAPIDescription), + ("test_manyDocumentNoIncludesWithAPIDescription_encode", test_manyDocumentNoIncludesWithAPIDescription_encode), ("test_manyDocumentSomeIncludes", test_manyDocumentSomeIncludes), ("test_manyDocumentSomeIncludes_encode", test_manyDocumentSomeIncludes_encode), + ("test_manyDocumentSomeIncludesWithAPIDescription", test_manyDocumentSomeIncludesWithAPIDescription), + ("test_manyDocumentSomeIncludesWithAPIDescription_encode", test_manyDocumentSomeIncludesWithAPIDescription_encode), ("test_metaDataDocument", test_metaDataDocument), ("test_metaDataDocument_encode", test_metaDataDocument_encode), + ("test_metaDataDocumentFailsIfMissingAPIDescription", test_metaDataDocumentFailsIfMissingAPIDescription), + ("test_metaDataDocumentWithAPIDescription", test_metaDataDocumentWithAPIDescription), + ("test_metaDataDocumentWithAPIDescription_encode", test_metaDataDocumentWithAPIDescription_encode), ("test_metaDataDocumentWithLinks", test_metaDataDocumentWithLinks), ("test_metaDataDocumentWithLinks_encode", test_metaDataDocumentWithLinks_encode), + ("test_metaDataDocumentWithLinksWithAPIDescription", test_metaDataDocumentWithLinksWithAPIDescription), + ("test_metaDataDocumentWithLinksWithAPIDescription_encode", test_metaDataDocumentWithLinksWithAPIDescription_encode), ("test_metaDocumentMissingMeta", test_metaDocumentMissingMeta), ("test_singleDocument_PolyPrimaryResource", test_singleDocument_PolyPrimaryResource), ("test_singleDocument_PolyPrimaryResource_encode", test_singleDocument_PolyPrimaryResource_encode), + ("test_singleDocument_PolyPrimaryResourceWithAPIDescription", test_singleDocument_PolyPrimaryResourceWithAPIDescription), + ("test_singleDocument_PolyPrimaryResourceWithAPIDescription_encode", test_singleDocument_PolyPrimaryResourceWithAPIDescription_encode), ("test_singleDocumentNoIncludes", test_singleDocumentNoIncludes), ("test_singleDocumentNoIncludes_encode", test_singleDocumentNoIncludes_encode), + ("test_singleDocumentNoIncludesMissingAPIDescription", test_singleDocumentNoIncludesMissingAPIDescription), ("test_singleDocumentNoIncludesMissingMetadata", test_singleDocumentNoIncludesMissingMetadata), ("test_singleDocumentNoIncludesOptionalNotNull", test_singleDocumentNoIncludesOptionalNotNull), ("test_singleDocumentNoIncludesOptionalNotNull_encode", test_singleDocumentNoIncludesOptionalNotNull_encode), + ("test_singleDocumentNoIncludesOptionalNotNullWithAPIDescription", test_singleDocumentNoIncludesOptionalNotNullWithAPIDescription), + ("test_singleDocumentNoIncludesOptionalNotNullWithAPIDescription_encode", test_singleDocumentNoIncludesOptionalNotNullWithAPIDescription_encode), + ("test_singleDocumentNoIncludesWithAPIDescription", test_singleDocumentNoIncludesWithAPIDescription), + ("test_singleDocumentNoIncludesWithAPIDescription_encode", test_singleDocumentNoIncludesWithAPIDescription_encode), ("test_singleDocumentNoIncludesWithLinks", test_singleDocumentNoIncludesWithLinks), ("test_singleDocumentNoIncludesWithLinks_encode", test_singleDocumentNoIncludesWithLinks_encode), + ("test_singleDocumentNoIncludesWithLinksWithAPIDescription", test_singleDocumentNoIncludesWithLinksWithAPIDescription), + ("test_singleDocumentNoIncludesWithLinksWithAPIDescription_encode", test_singleDocumentNoIncludesWithLinksWithAPIDescription_encode), ("test_singleDocumentNoIncludesWithMetadata", test_singleDocumentNoIncludesWithMetadata), ("test_singleDocumentNoIncludesWithMetadata_encode", test_singleDocumentNoIncludesWithMetadata_encode), ("test_singleDocumentNoIncludesWithMetadataMissingLinks", test_singleDocumentNoIncludesWithMetadataMissingLinks), + ("test_singleDocumentNoIncludesWithMetadataWithAPIDescription", test_singleDocumentNoIncludesWithMetadataWithAPIDescription), + ("test_singleDocumentNoIncludesWithMetadataWithAPIDescription_encode", test_singleDocumentNoIncludesWithMetadataWithAPIDescription_encode), ("test_singleDocumentNoIncludesWithMetadataWithLinks", test_singleDocumentNoIncludesWithMetadataWithLinks), ("test_singleDocumentNoIncludesWithMetadataWithLinks_encode", test_singleDocumentNoIncludesWithMetadataWithLinks_encode), + ("test_singleDocumentNoIncludesWithMetadataWithLinksWithAPIDescription", test_singleDocumentNoIncludesWithMetadataWithLinksWithAPIDescription), + ("test_singleDocumentNoIncludesWithMetadataWithLinksWithAPIDescription_encode", test_singleDocumentNoIncludesWithMetadataWithLinksWithAPIDescription_encode), ("test_singleDocumentNoIncludesWithSomeIncludesMetadataWithLinks_encode", test_singleDocumentNoIncludesWithSomeIncludesMetadataWithLinks_encode), + ("test_singleDocumentNoIncludesWithSomeIncludesMetadataWithLinksWithAPIDescription_encode", test_singleDocumentNoIncludesWithSomeIncludesMetadataWithLinksWithAPIDescription_encode), ("test_singleDocumentNoIncludesWithSomeIncludesWithMetadataWithLinks", test_singleDocumentNoIncludesWithSomeIncludesWithMetadataWithLinks), + ("test_singleDocumentNoIncludesWithSomeIncludesWithMetadataWithLinksWithAPIDescription", test_singleDocumentNoIncludesWithSomeIncludesWithMetadataWithLinksWithAPIDescription), ("test_singleDocumentNonOptionalFailsOnNull", test_singleDocumentNonOptionalFailsOnNull), ("test_singleDocumentNull", test_singleDocumentNull), ("test_singleDocumentNull_encode", test_singleDocumentNull_encode), + ("test_singleDocumentNullFailsWithNoAPIDescription", test_singleDocumentNullFailsWithNoAPIDescription), ("test_singleDocumentNullWithAPIDescription", test_singleDocumentNullWithAPIDescription), ("test_singleDocumentNullWithAPIDescription_encode", test_singleDocumentNullWithAPIDescription_encode), ("test_singleDocumentSomeIncludes", test_singleDocumentSomeIncludes), ("test_singleDocumentSomeIncludes_encode", test_singleDocumentSomeIncludes_encode), + ("test_singleDocumentSomeIncludesWithAPIDescription", test_singleDocumentSomeIncludesWithAPIDescription), + ("test_singleDocumentSomeIncludesWithAPIDescription_encode", test_singleDocumentSomeIncludesWithAPIDescription_encode), ("test_singleDocumentSomeIncludesWithMetadata", test_singleDocumentSomeIncludesWithMetadata), ("test_singleDocumentSomeIncludesWithMetadata_encode", test_singleDocumentSomeIncludesWithMetadata_encode), + ("test_singleDocumentSomeIncludesWithMetadataWithAPIDescription", test_singleDocumentSomeIncludesWithMetadataWithAPIDescription), + ("test_singleDocumentSomeIncludesWithMetadataWithAPIDescription_encode", test_singleDocumentSomeIncludesWithMetadataWithAPIDescription_encode), ("test_unknownErrorDocumentMissingLinks", test_unknownErrorDocumentMissingLinks), ("test_unknownErrorDocumentMissingLinks_encode", test_unknownErrorDocumentMissingLinks_encode), + ("test_unknownErrorDocumentMissingLinksWithAPIDescription", test_unknownErrorDocumentMissingLinksWithAPIDescription), + ("test_unknownErrorDocumentMissingLinksWithAPIDescription_encode", test_unknownErrorDocumentMissingLinksWithAPIDescription_encode), ("test_unknownErrorDocumentMissingMeta", test_unknownErrorDocumentMissingMeta), ("test_unknownErrorDocumentMissingMeta_encode", test_unknownErrorDocumentMissingMeta_encode), + ("test_unknownErrorDocumentMissingMetaWithAPIDescription", test_unknownErrorDocumentMissingMetaWithAPIDescription), + ("test_unknownErrorDocumentMissingMetaWithAPIDescription_encode", test_unknownErrorDocumentMissingMetaWithAPIDescription_encode), ("test_unknownErrorDocumentNoMeta", test_unknownErrorDocumentNoMeta), ("test_unknownErrorDocumentNoMeta_encode", test_unknownErrorDocumentNoMeta_encode), + ("test_unknownErrorDocumentNoMetaWithAPIDescription", test_unknownErrorDocumentNoMetaWithAPIDescription), + ("test_unknownErrorDocumentNoMetaWithAPIDescription_encode", test_unknownErrorDocumentNoMetaWithAPIDescription_encode), ("test_unknownErrorDocumentWithLinks", test_unknownErrorDocumentWithLinks), ("test_unknownErrorDocumentWithLinks_encode", test_unknownErrorDocumentWithLinks_encode), + ("test_unknownErrorDocumentWithLinksWithAPIDescription", test_unknownErrorDocumentWithLinksWithAPIDescription), + ("test_unknownErrorDocumentWithLinksWithAPIDescription_encode", test_unknownErrorDocumentWithLinksWithAPIDescription_encode), ("test_unknownErrorDocumentWithMeta", test_unknownErrorDocumentWithMeta), ("test_unknownErrorDocumentWithMeta_encode", test_unknownErrorDocumentWithMeta_encode), + ("test_unknownErrorDocumentWithMetaWithAPIDescription", test_unknownErrorDocumentWithMetaWithAPIDescription), + ("test_unknownErrorDocumentWithMetaWithAPIDescription_encode", test_unknownErrorDocumentWithMetaWithAPIDescription_encode), ("test_unknownErrorDocumentWithMetaWithLinks", test_unknownErrorDocumentWithMetaWithLinks), ("test_unknownErrorDocumentWithMetaWithLinks_encode", test_unknownErrorDocumentWithMetaWithLinks_encode), + ("test_unknownErrorDocumentWithMetaWithLinksWithAPIDescription", test_unknownErrorDocumentWithMetaWithLinksWithAPIDescription), + ("test_unknownErrorDocumentWithMetaWithLinksWithAPIDescription_encode", test_unknownErrorDocumentWithMetaWithLinksWithAPIDescription_encode), ] } @@ -261,6 +315,7 @@ extension ResourceBodyTests { #if !os(macOS) public func __allTests() -> [XCTestCaseEntry] { return [ + testCase(APIDescriptionTests.__allTests), testCase(AttributeTests.__allTests), testCase(Attribute_FunctorTests.__allTests), testCase(Attribute_LiteralTests.__allTests),