From 39c6d6e8d6c03de57cef8dc1441a00040c77ea81 Mon Sep 17 00:00:00 2001 From: Javier Cicchelli Date: Tue, 9 Sep 2025 17:20:05 +0000 Subject: [PATCH] Basic update of the existing files in the project (#3) This PR contains the work done to: * update the `Package.swift` file; * update the file headers of the existing file in the project; * update the cases of the `AmiiboServiceLiveTests` tests. Reviewed-on: https://repo.rock-n-code.com/rock-n-code/amiibo-service/pulls/3 Co-authored-by: Javier Cicchelli Co-committed-by: Javier Cicchelli --- Makefile | 4 +- Package.swift | 24 +- README.md | 2 +- .../Extensions/Client+Properties.swift | 29 -- .../Extensions/DateFormatter+Properties.swift | 4 +- Sources/Internal/Protocols/APIClient.swift | 4 +- .../Internal/Protocols/KeyNameFilter.swift | 4 +- Sources/Internal/Protocols/KeyNameModel.swift | 4 +- .../Transcoders/ISODateTranscoder.swift | 4 +- Sources/Public/Clients/AmiiboLiveClient.swift | 6 +- Sources/Public/Clients/AmiiboMockClient.swift | 4 +- .../Public/Errors/AmiiboServiceError.swift | 4 +- Sources/Public/Filters/AmiiboFilter.swift | 4 +- .../Public/Filters/AmiiboSeriesFilter.swift | 4 +- Sources/Public/Filters/AmiiboTypeFilter.swift | 4 +- .../Public/Filters/GameCharacterFilter.swift | 4 +- Sources/Public/Filters/GameSeriesFilter.swift | 4 +- Sources/Public/Models/Amiibo.swift | 4 +- .../Public/Models/Amiibo/Amiibo+Game.swift | 4 +- .../Models/Amiibo/Amiibo+Platform.swift | 4 +- .../Public/Models/Amiibo/Amiibo+Release.swift | 4 +- .../Public/Models/Amiibo/Amiibo+Usage.swift | 4 +- Sources/Public/Models/AmiiboSeries.swift | 4 +- Sources/Public/Models/AmiiboType.swift | 4 +- Sources/Public/Models/GameCharacter.swift | 4 +- Sources/Public/Models/GameSeries.swift | 4 +- Sources/Public/Services/AmiiboService.swift | 4 +- Sources/openapi-generator-config.yaml | 5 +- Sources/openapi.yaml | 4 +- Tests/AmiiboServiceLiveTests.swift | 380 +++++++++--------- 30 files changed, 258 insertions(+), 284 deletions(-) delete mode 100644 Sources/Internal/Extensions/Client+Properties.swift diff --git a/Makefile b/Makefile index 7107182..04010b0 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,8 @@ # ===----------------------------------------------------------------------=== # -# This source file is part of the AmiiboAPI open source project +# This source file is part of the AmiiboService open source project # -# Copyright (c) 2024 Röck+Cöde VoF. and the AmiiboAPI project authors +# Copyright (c) 2024-2025 Röck+Cöde VoF. and the AmiiboAPI project authors # Licensed under the EUPL 1.2 or later. # # See LICENSE for license information diff --git a/Package.swift b/Package.swift index 2a0813b..041d9d2 100644 --- a/Package.swift +++ b/Package.swift @@ -2,9 +2,9 @@ //===----------------------------------------------------------------------=== // -// This source file is part of the AmiiboAPI open source project +// This source file is part of the AmiiboService open source project // -// Copyright (c) 2024 Röck+Cöde VoF. and the AmiiboAPI project authors +// Copyright (c) 2024-2025 Röck+Cöde VoF. and the AmiiboAPI project authors // Licensed under the EUPL 1.2 or later. // // See LICENSE for license information @@ -15,7 +15,7 @@ import PackageDescription let package = Package( - name: AmiiboAPI.package, + name: AmiiboService.package, platforms: [ .iOS(.v13), .macOS(.v10_15), @@ -25,9 +25,9 @@ let package = Package( ], products: [ .library( - name: AmiiboAPI.package, + name: AmiiboService.package, targets: [ - AmiiboAPI.target + AmiiboService.target ] ) ], @@ -47,7 +47,7 @@ let package = Package( ], targets: [ .target( - name: AmiiboAPI.target, + name: AmiiboService.target, dependencies: [ .product( name: "OpenAPIRuntime", @@ -67,9 +67,9 @@ let package = Package( ] ), .testTarget( - name: AmiiboAPI.test, + name: AmiiboService.test, dependencies: [ - .byName(name: AmiiboAPI.target) + .byName(name: AmiiboService.target) ], path: "Tests" ), @@ -78,8 +78,8 @@ let package = Package( // MARK: - Constants -enum AmiiboAPI { - static let package = "amiibo-api" - static let target = "AmiiboAPI" - static let test = "\(AmiiboAPI.target)Tests" +enum AmiiboService { + static let package = "amiibo-service" + static let target = "AmiiboService" + static let test = "\(AmiiboService.target)Tests" } diff --git a/README.md b/README.md index 9ffe8fb..569f56a 100644 --- a/README.md +++ b/README.md @@ -1 +1 @@ -# Amiibo API +# Amiibo Service diff --git a/Sources/Internal/Extensions/Client+Properties.swift b/Sources/Internal/Extensions/Client+Properties.swift deleted file mode 100644 index 23f090c..0000000 --- a/Sources/Internal/Extensions/Client+Properties.swift +++ /dev/null @@ -1,29 +0,0 @@ -//===----------------------------------------------------------------------=== -// -// This source file is part of the AmiiboAPI open source project -// -// Copyright (c) 2024 Röck+Cöde VoF. and the AmiiboAPI project authors -// Licensed under the EUPL 1.2 or later. -// -// See LICENSE for license information -// See CONTRIBUTORS for the list of AmiiboAPI project authors -// -//===----------------------------------------------------------------------=== - -import OpenAPIURLSession - -extension Client { - - // MARK: Constants - - static var live: Client { - get throws { - .init( - serverURL: try Servers.server1(), - configuration: .init(dateTranscoder: ISODateTranscoder()), - transport: URLSessionTransport() - ) - } - } - -} diff --git a/Sources/Internal/Extensions/DateFormatter+Properties.swift b/Sources/Internal/Extensions/DateFormatter+Properties.swift index 6c9cce9..5a8e372 100644 --- a/Sources/Internal/Extensions/DateFormatter+Properties.swift +++ b/Sources/Internal/Extensions/DateFormatter+Properties.swift @@ -1,8 +1,8 @@ //===----------------------------------------------------------------------=== // -// This source file is part of the AmiiboAPI open source project +// This source file is part of the AmiiboService open source project // -// Copyright (c) 2024 Röck+Cöde VoF. and the AmiiboAPI project authors +// Copyright (c) 2024-2025 Röck+Cöde VoF. and the AmiiboAPI project authors // Licensed under the EUPL 1.2 or later. // // See LICENSE for license information diff --git a/Sources/Internal/Protocols/APIClient.swift b/Sources/Internal/Protocols/APIClient.swift index 568f862..bcb90ae 100644 --- a/Sources/Internal/Protocols/APIClient.swift +++ b/Sources/Internal/Protocols/APIClient.swift @@ -1,8 +1,8 @@ //===----------------------------------------------------------------------=== // -// This source file is part of the AmiiboAPI open source project +// This source file is part of the AmiiboService open source project // -// Copyright (c) 2024 Röck+Cöde VoF. and the AmiiboAPI project authors +// Copyright (c) 2024-2025 Röck+Cöde VoF. and the AmiiboAPI project authors // Licensed under the EUPL 1.2 or later. // // See LICENSE for license information diff --git a/Sources/Internal/Protocols/KeyNameFilter.swift b/Sources/Internal/Protocols/KeyNameFilter.swift index 29cd4a4..ad7d825 100644 --- a/Sources/Internal/Protocols/KeyNameFilter.swift +++ b/Sources/Internal/Protocols/KeyNameFilter.swift @@ -1,8 +1,8 @@ //===----------------------------------------------------------------------=== // -// This source file is part of the AmiiboAPI open source project +// This source file is part of the AmiiboService open source project // -// Copyright (c) 2024 Röck+Cöde VoF. and the AmiiboAPI project authors +// Copyright (c) 2024-2025 Röck+Cöde VoF. and the AmiiboAPI project authors // Licensed under the EUPL 1.2 or later. // // See LICENSE for license information diff --git a/Sources/Internal/Protocols/KeyNameModel.swift b/Sources/Internal/Protocols/KeyNameModel.swift index f1c023a..0d5bc16 100644 --- a/Sources/Internal/Protocols/KeyNameModel.swift +++ b/Sources/Internal/Protocols/KeyNameModel.swift @@ -1,8 +1,8 @@ //===----------------------------------------------------------------------=== // -// This source file is part of the AmiiboAPI open source project +// This source file is part of the AmiiboService open source project // -// Copyright (c) 2024 Röck+Cöde VoF. and the AmiiboAPI project authors +// Copyright (c) 2024-2025 Röck+Cöde VoF. and the AmiiboAPI project authors // Licensed under the EUPL 1.2 or later. // // See LICENSE for license information diff --git a/Sources/Internal/Transcoders/ISODateTranscoder.swift b/Sources/Internal/Transcoders/ISODateTranscoder.swift index 2a9a91d..6b81d5b 100644 --- a/Sources/Internal/Transcoders/ISODateTranscoder.swift +++ b/Sources/Internal/Transcoders/ISODateTranscoder.swift @@ -1,8 +1,8 @@ //===----------------------------------------------------------------------=== // -// This source file is part of the AmiiboAPI open source project +// This source file is part of the AmiiboService open source project // -// Copyright (c) 2024 Röck+Cöde VoF. and the AmiiboAPI project authors +// Copyright (c) 2024-2025 Röck+Cöde VoF. and the AmiiboAPI project authors // Licensed under the EUPL 1.2 or later. // // See LICENSE for license information diff --git a/Sources/Public/Clients/AmiiboLiveClient.swift b/Sources/Public/Clients/AmiiboLiveClient.swift index 6028575..49ef078 100644 --- a/Sources/Public/Clients/AmiiboLiveClient.swift +++ b/Sources/Public/Clients/AmiiboLiveClient.swift @@ -1,8 +1,8 @@ //===----------------------------------------------------------------------=== // -// This source file is part of the AmiiboAPI open source project +// This source file is part of the AmiiboService open source project // -// Copyright (c) 2024 Röck+Cöde VoF. and the AmiiboAPI project authors +// Copyright (c) 2024-2025 Röck+Cöde VoF. and the AmiiboAPI project authors // Licensed under the EUPL 1.2 or later. // // See LICENSE for license information @@ -24,7 +24,7 @@ public struct AmiiboLiveClient { public init() throws { self.client = .init( - serverURL: try Servers.server1(), + serverURL: try Servers.Server1.url(), configuration: .init(dateTranscoder: ISODateTranscoder()), transport: URLSessionTransport() ) diff --git a/Sources/Public/Clients/AmiiboMockClient.swift b/Sources/Public/Clients/AmiiboMockClient.swift index dbcb754..e3bb572 100644 --- a/Sources/Public/Clients/AmiiboMockClient.swift +++ b/Sources/Public/Clients/AmiiboMockClient.swift @@ -1,8 +1,8 @@ //===----------------------------------------------------------------------=== // -// This source file is part of the AmiiboAPI open source project +// This source file is part of the AmiiboService open source project // -// Copyright (c) 2024 Röck+Cöde VoF. and the AmiiboAPI project authors +// Copyright (c) 2024-2025 Röck+Cöde VoF. and the AmiiboAPI project authors // Licensed under the EUPL 1.2 or later. // // See LICENSE for license information diff --git a/Sources/Public/Errors/AmiiboServiceError.swift b/Sources/Public/Errors/AmiiboServiceError.swift index 7b59b07..57d32f4 100644 --- a/Sources/Public/Errors/AmiiboServiceError.swift +++ b/Sources/Public/Errors/AmiiboServiceError.swift @@ -1,8 +1,8 @@ //===----------------------------------------------------------------------=== // -// This source file is part of the AmiiboAPI open source project +// This source file is part of the AmiiboService open source project // -// Copyright (c) 2024 Röck+Cöde VoF. and the AmiiboAPI project authors +// Copyright (c) 2024-2025 Röck+Cöde VoF. and the AmiiboAPI project authors // Licensed under the EUPL 1.2 or later. // // See LICENSE for license information diff --git a/Sources/Public/Filters/AmiiboFilter.swift b/Sources/Public/Filters/AmiiboFilter.swift index 4d714be..45b9186 100644 --- a/Sources/Public/Filters/AmiiboFilter.swift +++ b/Sources/Public/Filters/AmiiboFilter.swift @@ -1,8 +1,8 @@ //===----------------------------------------------------------------------=== // -// This source file is part of the AmiiboAPI open source project +// This source file is part of the AmiiboService open source project // -// Copyright (c) 2024 Röck+Cöde VoF. and the AmiiboAPI project authors +// Copyright (c) 2024-2025 Röck+Cöde VoF. and the AmiiboAPI project authors // Licensed under the EUPL 1.2 or later. // // See LICENSE for license information diff --git a/Sources/Public/Filters/AmiiboSeriesFilter.swift b/Sources/Public/Filters/AmiiboSeriesFilter.swift index 1691904..c10f4dc 100644 --- a/Sources/Public/Filters/AmiiboSeriesFilter.swift +++ b/Sources/Public/Filters/AmiiboSeriesFilter.swift @@ -1,8 +1,8 @@ //===----------------------------------------------------------------------=== // -// This source file is part of the AmiiboAPI open source project +// This source file is part of the AmiiboService open source project // -// Copyright (c) 2024 Röck+Cöde VoF. and the AmiiboAPI project authors +// Copyright (c) 2024-2025 Röck+Cöde VoF. and the AmiiboAPI project authors // Licensed under the EUPL 1.2 or later. // // See LICENSE for license information diff --git a/Sources/Public/Filters/AmiiboTypeFilter.swift b/Sources/Public/Filters/AmiiboTypeFilter.swift index 438ab51..04d709a 100644 --- a/Sources/Public/Filters/AmiiboTypeFilter.swift +++ b/Sources/Public/Filters/AmiiboTypeFilter.swift @@ -1,8 +1,8 @@ //===----------------------------------------------------------------------=== // -// This source file is part of the AmiiboAPI open source project +// This source file is part of the AmiiboService open source project // -// Copyright (c) 2024 Röck+Cöde VoF. and the AmiiboAPI project authors +// Copyright (c) 2024-2025 Röck+Cöde VoF. and the AmiiboAPI project authors // Licensed under the EUPL 1.2 or later. // // See LICENSE for license information diff --git a/Sources/Public/Filters/GameCharacterFilter.swift b/Sources/Public/Filters/GameCharacterFilter.swift index 0fede7e..27a2ddf 100644 --- a/Sources/Public/Filters/GameCharacterFilter.swift +++ b/Sources/Public/Filters/GameCharacterFilter.swift @@ -1,8 +1,8 @@ //===----------------------------------------------------------------------=== // -// This source file is part of the AmiiboAPI open source project +// This source file is part of the AmiiboService open source project // -// Copyright (c) 2024 Röck+Cöde VoF. and the AmiiboAPI project authors +// Copyright (c) 2024-2025 Röck+Cöde VoF. and the AmiiboAPI project authors // Licensed under the EUPL 1.2 or later. // // See LICENSE for license information diff --git a/Sources/Public/Filters/GameSeriesFilter.swift b/Sources/Public/Filters/GameSeriesFilter.swift index f02d59c..837a5bb 100644 --- a/Sources/Public/Filters/GameSeriesFilter.swift +++ b/Sources/Public/Filters/GameSeriesFilter.swift @@ -1,8 +1,8 @@ //===----------------------------------------------------------------------=== // -// This source file is part of the AmiiboAPI open source project +// This source file is part of the AmiiboService open source project // -// Copyright (c) 2024 Röck+Cöde VoF. and the AmiiboAPI project authors +// Copyright (c) 2024-2025 Röck+Cöde VoF. and the AmiiboAPI project authors // Licensed under the EUPL 1.2 or later. // // See LICENSE for license information diff --git a/Sources/Public/Models/Amiibo.swift b/Sources/Public/Models/Amiibo.swift index 1518d9b..a91d5af 100644 --- a/Sources/Public/Models/Amiibo.swift +++ b/Sources/Public/Models/Amiibo.swift @@ -1,8 +1,8 @@ //===----------------------------------------------------------------------=== // -// This source file is part of the AmiiboAPI open source project +// This source file is part of the AmiiboService open source project // -// Copyright (c) 2024 Röck+Cöde VoF. and the AmiiboAPI project authors +// Copyright (c) 2024-2025 Röck+Cöde VoF. and the AmiiboAPI project authors // Licensed under the EUPL 1.2 or later. // // See LICENSE for license information diff --git a/Sources/Public/Models/Amiibo/Amiibo+Game.swift b/Sources/Public/Models/Amiibo/Amiibo+Game.swift index 1e2b450..fe95824 100644 --- a/Sources/Public/Models/Amiibo/Amiibo+Game.swift +++ b/Sources/Public/Models/Amiibo/Amiibo+Game.swift @@ -1,8 +1,8 @@ //===----------------------------------------------------------------------=== // -// This source file is part of the AmiiboAPI open source project +// This source file is part of the AmiiboService open source project // -// Copyright (c) 2024 Röck+Cöde VoF. and the AmiiboAPI project authors +// Copyright (c) 2024-2025 Röck+Cöde VoF. and the AmiiboAPI project authors // Licensed under the EUPL 1.2 or later. // // See LICENSE for license information diff --git a/Sources/Public/Models/Amiibo/Amiibo+Platform.swift b/Sources/Public/Models/Amiibo/Amiibo+Platform.swift index 66ed86d..283cf06 100644 --- a/Sources/Public/Models/Amiibo/Amiibo+Platform.swift +++ b/Sources/Public/Models/Amiibo/Amiibo+Platform.swift @@ -1,8 +1,8 @@ //===----------------------------------------------------------------------=== // -// This source file is part of the AmiiboAPI open source project +// This source file is part of the AmiiboService open source project // -// Copyright (c) 2024 Röck+Cöde VoF. and the AmiiboAPI project authors +// Copyright (c) 2024-2025 Röck+Cöde VoF. and the AmiiboAPI project authors // Licensed under the EUPL 1.2 or later. // // See LICENSE for license information diff --git a/Sources/Public/Models/Amiibo/Amiibo+Release.swift b/Sources/Public/Models/Amiibo/Amiibo+Release.swift index 8e5adab..6357fe0 100644 --- a/Sources/Public/Models/Amiibo/Amiibo+Release.swift +++ b/Sources/Public/Models/Amiibo/Amiibo+Release.swift @@ -1,8 +1,8 @@ //===----------------------------------------------------------------------=== // -// This source file is part of the AmiiboAPI open source project +// This source file is part of the AmiiboService open source project // -// Copyright (c) 2024 Röck+Cöde VoF. and the AmiiboAPI project authors +// Copyright (c) 2024-2025 Röck+Cöde VoF. and the AmiiboAPI project authors // Licensed under the EUPL 1.2 or later. // // See LICENSE for license information diff --git a/Sources/Public/Models/Amiibo/Amiibo+Usage.swift b/Sources/Public/Models/Amiibo/Amiibo+Usage.swift index 7b738b9..abfd898 100644 --- a/Sources/Public/Models/Amiibo/Amiibo+Usage.swift +++ b/Sources/Public/Models/Amiibo/Amiibo+Usage.swift @@ -1,8 +1,8 @@ //===----------------------------------------------------------------------=== // -// This source file is part of the AmiiboAPI open source project +// This source file is part of the AmiiboService open source project // -// Copyright (c) 2024 Röck+Cöde VoF. and the AmiiboAPI project authors +// Copyright (c) 2024-2025 Röck+Cöde VoF. and the AmiiboAPI project authors // Licensed under the EUPL 1.2 or later. // // See LICENSE for license information diff --git a/Sources/Public/Models/AmiiboSeries.swift b/Sources/Public/Models/AmiiboSeries.swift index 5a6c814..ac734be 100644 --- a/Sources/Public/Models/AmiiboSeries.swift +++ b/Sources/Public/Models/AmiiboSeries.swift @@ -1,8 +1,8 @@ //===----------------------------------------------------------------------=== // -// This source file is part of the AmiiboAPI open source project +// This source file is part of the AmiiboService open source project // -// Copyright (c) 2024 Röck+Cöde VoF. and the AmiiboAPI project authors +// Copyright (c) 2024-2025 Röck+Cöde VoF. and the AmiiboAPI project authors // Licensed under the EUPL 1.2 or later. // // See LICENSE for license information diff --git a/Sources/Public/Models/AmiiboType.swift b/Sources/Public/Models/AmiiboType.swift index 2c57ee6..a9f0043 100644 --- a/Sources/Public/Models/AmiiboType.swift +++ b/Sources/Public/Models/AmiiboType.swift @@ -1,8 +1,8 @@ //===----------------------------------------------------------------------=== // -// This source file is part of the AmiiboAPI open source project +// This source file is part of the AmiiboService open source project // -// Copyright (c) 2024 Röck+Cöde VoF. and the AmiiboAPI project authors +// Copyright (c) 2024-2025 Röck+Cöde VoF. and the AmiiboAPI project authors // Licensed under the EUPL 1.2 or later. // // See LICENSE for license information diff --git a/Sources/Public/Models/GameCharacter.swift b/Sources/Public/Models/GameCharacter.swift index 2421104..62df719 100644 --- a/Sources/Public/Models/GameCharacter.swift +++ b/Sources/Public/Models/GameCharacter.swift @@ -1,8 +1,8 @@ //===----------------------------------------------------------------------=== // -// This source file is part of the AmiiboAPI open source project +// This source file is part of the AmiiboService open source project // -// Copyright (c) 2024 Röck+Cöde VoF. and the AmiiboAPI project authors +// Copyright (c) 2024-2025 Röck+Cöde VoF. and the AmiiboAPI project authors // Licensed under the EUPL 1.2 or later. // // See LICENSE for license information diff --git a/Sources/Public/Models/GameSeries.swift b/Sources/Public/Models/GameSeries.swift index 25d0ec8..006e3df 100644 --- a/Sources/Public/Models/GameSeries.swift +++ b/Sources/Public/Models/GameSeries.swift @@ -1,8 +1,8 @@ //===----------------------------------------------------------------------=== // -// This source file is part of the AmiiboAPI open source project +// This source file is part of the AmiiboService open source project // -// Copyright (c) 2024 Röck+Cöde VoF. and the AmiiboAPI project authors +// Copyright (c) 2024-2025 Röck+Cöde VoF. and the AmiiboAPI project authors // Licensed under the EUPL 1.2 or later. // // See LICENSE for license information diff --git a/Sources/Public/Services/AmiiboService.swift b/Sources/Public/Services/AmiiboService.swift index f983a3a..2b9c508 100644 --- a/Sources/Public/Services/AmiiboService.swift +++ b/Sources/Public/Services/AmiiboService.swift @@ -1,8 +1,8 @@ //===----------------------------------------------------------------------=== // -// This source file is part of the AmiiboAPI open source project +// This source file is part of the AmiiboService open source project // -// Copyright (c) 2024 Röck+Cöde VoF. and the AmiiboAPI project authors +// Copyright (c) 2024-2025 Röck+Cöde VoF. and the AmiiboAPI project authors // Licensed under the EUPL 1.2 or later. // // See LICENSE for license information diff --git a/Sources/openapi-generator-config.yaml b/Sources/openapi-generator-config.yaml index 5babde7..e6015bb 100644 --- a/Sources/openapi-generator-config.yaml +++ b/Sources/openapi-generator-config.yaml @@ -1,8 +1,8 @@ # ===----------------------------------------------------------------------=== # -# This source file is part of the AmiiboAPI open source project +# This source file is part of the AmiiboService open source project # -# Copyright (c) 2024 Röck+Cöde VoF. and the AmiiboAPI project authors +# Copyright (c) 2024-2025 Röck+Cöde VoF. and the AmiiboAPI project authors # Licensed under the EUPL 1.2 or later. # # See LICENSE for license information @@ -13,4 +13,5 @@ generate: - types - client +namingStrategy: defensive accessModifier: internal diff --git a/Sources/openapi.yaml b/Sources/openapi.yaml index b69ca5d..5762fe4 100644 --- a/Sources/openapi.yaml +++ b/Sources/openapi.yaml @@ -1,8 +1,8 @@ # ===----------------------------------------------------------------------=== # -# This source file is part of the AmiiboAPI open source project +# This source file is part of the AmiiboService open source project # -# Copyright (c) 2024 Röck+Cöde VoF. and the AmiiboAPI project authors +# Copyright (c) 2024-2025 Röck+Cöde VoF. and the AmiiboAPI project authors # Licensed under the EUPL 1.2 or later. # # See LICENSE for license information diff --git a/Tests/AmiiboServiceLiveTests.swift b/Tests/AmiiboServiceLiveTests.swift index 6742af0..7c581ee 100644 --- a/Tests/AmiiboServiceLiveTests.swift +++ b/Tests/AmiiboServiceLiveTests.swift @@ -1,8 +1,8 @@ //===----------------------------------------------------------------------=== // -// This source file is part of the AmiiboAPI open source project +// This source file is part of the AmiiboService open source project // -// Copyright (c) 2024 Röck+Cöde VoF. and the AmiiboAPI project authors +// Copyright (c) 2024-2025 Röck+Cöde VoF. and the AmiiboAPI project authors // Licensed under the EUPL 1.2 or later. // // See LICENSE for license information @@ -10,10 +10,11 @@ // //===----------------------------------------------------------------------=== -import AmiiboAPI +import AmiiboService import Foundation import Testing +@Suite("Live service") struct AmiiboServiceLiveTests { // MARK: Properties @@ -30,23 +31,23 @@ struct AmiiboServiceLiveTests { // MARK: Functions tests - @Test("Get Amiibo items") - func getAmiibos() async throws { + @Test + func `get Amiibo items`() async throws { // GIVEN // WHEN let amiibos = try await service.getAmiibos() // THEN #expect(!amiibos.isEmpty) - #expect(amiibos.count == 853) + #expect(amiibos.count == 885) #expect(amiibos.first?.identifier == "0000000000000002") #expect(amiibos.first?.platform == nil) #expect(amiibos.last?.identifier == "3f000000042e0002") #expect(amiibos.last?.platform == nil) } - @Test("Get Amiibo items by an existing identifier") - func getAmiibos_byExistingIdentifier() async throws { + @Test + func `get Amiibo items by an existing identifier`() async throws { // GIVEN let identifier = "0000000000000002" @@ -60,8 +61,8 @@ struct AmiiboServiceLiveTests { #expect(amiibos.first?.platform == nil) } - @Test("Get Amiibo items by a non-existing identifier") - func getAmiibos_byNonExistingIdentifier() async throws { + @Test + func `get Amiibo items by a non-existing identifier`() async throws { // GIVEN let identifier = "0000000000000000" @@ -72,8 +73,8 @@ struct AmiiboServiceLiveTests { } } - @Test("Get Amiibo items by an incomplete identifier") - func getAmiibos_byIncompleteIdentifier() async throws { + @Test + func `get Amiibo items by an incomplete identifier`() async throws { // GIVEN let identifier = "0000000" @@ -84,8 +85,8 @@ struct AmiiboServiceLiveTests { } } - @Test("Get Amiibo items by an empty identifier") - func getAmiibos_byEmptyIdentifier() async throws { + @Test + func `get Amiibo items by an empty identifier`() async throws { // GIVEN let identifier = "" @@ -96,8 +97,8 @@ struct AmiiboServiceLiveTests { } } - @Test("Get Amiibo items by an existing name") - func getAmiibos_byExistingName() async throws { + @Test + func `get Amiibo items by an existing name`() async throws { // GIVEN let name = "zelda" @@ -117,8 +118,8 @@ struct AmiiboServiceLiveTests { #expect(nameLast.contains(name)) } - @Test("Get Amiibo items by a non-existing name") - func getAmiibos_byNonExistingName() async throws { + @Test + func `get Amiibo items by a non-existing name`() async throws { // GIVEN let name = "Something" @@ -129,8 +130,8 @@ struct AmiiboServiceLiveTests { #expect(amiibos.isEmpty) } - @Test("Get Amiibo items by an incomplete name") - func getAmiibos_byIncompleteName() async throws { + @Test + func `get Amiibo items by an incomplete name`() async throws { // GIVEN let name = "zel" @@ -150,8 +151,8 @@ struct AmiiboServiceLiveTests { #expect(nameLast.contains(name)) } - @Test("Get Amiibo items by an empty name") - func getAmiibos_byEmptyName() async throws { + @Test + func `get Amiibo items by an empty name`() async throws { // GIVEN let name = "" @@ -160,11 +161,11 @@ struct AmiiboServiceLiveTests { // THEN #expect(!amiibos.isEmpty) - #expect(amiibos.count == 853) + #expect(amiibos.count == 885) } - @Test("Get Amiibo items by an existing type key") - func getAmiibos_byExistingTypeKey() async throws { + @Test + func `get Amiibo items by an existing type key`() async throws { // GIVEN let key = "0x00" @@ -173,15 +174,15 @@ struct AmiiboServiceLiveTests { // THEN #expect(!amiibos.isEmpty) - #expect(amiibos.count == 227) + #expect(amiibos.count == 235) #expect(amiibos.first?.type == "Figure") #expect(amiibos.first?.platform == nil) #expect(amiibos.last?.type == "Figure") #expect(amiibos.last?.platform == nil) } - @Test("Get Amiibo items by an existing type name") - func getAmiibos_byExistingTypeName() async throws { + @Test + func `get Amiibo items by an existing type name`() async throws { // GIVEN let name = "figure" @@ -190,15 +191,15 @@ struct AmiiboServiceLiveTests { // THEN #expect(!amiibos.isEmpty) - #expect(amiibos.count == 227) + #expect(amiibos.count == 235) #expect(amiibos.first?.type == "Figure") #expect(amiibos.first?.platform == nil) #expect(amiibos.last?.type == "Figure") #expect(amiibos.last?.platform == nil) } - @Test("Get Amiibo items by a non-existing type key") - func getAmiibos_byNonExistingTypeKey() async throws { + @Test + func `get Amiibo items by a non-existing type key`() async throws { // GIVEN let key = "0x0f" @@ -209,8 +210,8 @@ struct AmiiboServiceLiveTests { #expect(amiibos.isEmpty) } - @Test("Get Amiibo items by a non-existing type name") - func getAmiibos_byNonExistingTypeName() async throws { + @Test + func `get Amiibo items by a non-existing type name`() async throws { // GIVEN let name = "something" @@ -221,8 +222,8 @@ struct AmiiboServiceLiveTests { #expect(amiibos.isEmpty) } - @Test("Get Amiibo items by an incomplete type key") - func getAmiibos_byIncompleteTypeKey() async throws { + @Test + func `get Amiibo items by an incomplete type key`() async throws { // GIVEN let key = "0x" @@ -233,8 +234,8 @@ struct AmiiboServiceLiveTests { } } - @Test("Get Amiibo items by an incomplete type name") - func getAmiibos_byIncompleteTypeName() async throws { + @Test + func `get Amiibo items by an incomplete type name`() async throws { // GIVEN let name = "fig" @@ -245,8 +246,8 @@ struct AmiiboServiceLiveTests { #expect(amiibos.isEmpty) } - @Test("Get Amiibo items by an empty type key") - func getAmiibos_byEmptyTypeKey() async throws { + @Test + func `get Amiibo items by an empty type key`() async throws { // GIVEN let key = "" @@ -257,8 +258,8 @@ struct AmiiboServiceLiveTests { #expect(amiibos.isEmpty) } - @Test("Get Amiibo items by an empty type name") - func getAmiibos_byEmptyTypeName() async throws { + @Test + func `get Amiibo items by an empty type name`() async throws { // GIVEN let name = "" @@ -269,8 +270,8 @@ struct AmiiboServiceLiveTests { #expect(amiibos.isEmpty) } - @Test("Get Amiibo items by an existing series key") - func getAmiibos_byExistingSeriesKey() async throws { + @Test + func `get Amiibo items by an existing series key`() async throws { // GIVEN let key = "0x00" @@ -286,8 +287,8 @@ struct AmiiboServiceLiveTests { #expect(amiibos.last?.platform == nil) } - @Test("Get Amiibo items by an existing series name") - func getAmiibos_byExistingSeriesName() async throws { + @Test + func `get Amiibo items by an existing series name`() async throws { // GIVEN let name = "Legend Of Zelda" @@ -296,15 +297,15 @@ struct AmiiboServiceLiveTests { // THEN #expect(!amiibos.isEmpty) - #expect(amiibos.count == 22) + #expect(amiibos.count == 26) #expect(amiibos.first?.series == name) #expect(amiibos.first?.platform == nil) #expect(amiibos.last?.series == name) #expect(amiibos.last?.platform == nil) } - @Test("Get Amiibo items by a non-existing series key") - func getAmiibos_byNonExistingSeriesKey() async throws { + @Test + func `get Amiibo items by a non-existing series key`() async throws { // GIVEN let key = "0xf9" @@ -315,8 +316,8 @@ struct AmiiboServiceLiveTests { #expect(amiibos.isEmpty) } - @Test("Get Amiibo items by a non-existing series name") - func getAmiibos_byNonExistingSeriesName() async throws { + @Test + func `get Amiibo items by a non-existing series name`() async throws { // GIVEN let name = "something" @@ -327,8 +328,8 @@ struct AmiiboServiceLiveTests { #expect(amiibos.isEmpty) } - @Test("Get Amiibo items by an incomplete series key") - func getAmiibos_byIncompleteSeriesKey() async throws { + @Test + func `get Amiibo items by an incomplete series key`() async throws { // GIVEN let key = "0x" @@ -339,8 +340,8 @@ struct AmiiboServiceLiveTests { } } - @Test("Get Amiibo items by an incomplete series name") - func getAmiibos_byIncompleteSeriesName() async throws { + @Test + func `get Amiibo items by an incomplete series name`() async throws { // GIVEN let name = "fig" @@ -348,11 +349,12 @@ struct AmiiboServiceLiveTests { let amiibos = try await service.getAmiibos(.init(series: name)) // THEN - #expect(amiibos.isEmpty) + #expect(!amiibos.isEmpty) + #expect(amiibos.count == 25) } - @Test("Get Amiibo items by an empty series key") - func getAmiibos_byEmptySeriesKey() async throws { + @Test + func `get Amiibo items by an empty series key`() async throws { // GIVEN let key = "" @@ -361,11 +363,11 @@ struct AmiiboServiceLiveTests { // THEN #expect(!amiibos.isEmpty) - #expect(amiibos.count == 853) + #expect(amiibos.count == 885) } - @Test("Get Amiibo items by an empty series name") - func getAmiibos_byEmptySeriesName() async throws { + @Test + func `get Amiibo items by an empty series name`() async throws { // GIVEN let name = "" @@ -374,11 +376,11 @@ struct AmiiboServiceLiveTests { // THEN #expect(!amiibos.isEmpty) - #expect(amiibos.count == 853) + #expect(amiibos.count == 885) } - @Test("Get Amiibo items by an existing game character key") - func getAmiibos_byExistingGameCharacterKey() async throws { + @Test + func `get Amiibo items by an existing game character key`() async throws { // GIVEN let key = "0x00" @@ -394,8 +396,8 @@ struct AmiiboServiceLiveTests { #expect(amiibos.last?.platform == nil) } - @Test("Get Amiibo items by an existing game character name") - func getAmiibos_byExistingGameCharacterName() async throws { + @Test + func `get Amiibo items by an existing game character name`() async throws { // GIVEN let name = "Zelda" @@ -411,8 +413,8 @@ struct AmiiboServiceLiveTests { #expect(amiibos.last?.platform == nil) } - @Test("Get Amiibo items by a non-existing game character key") - func getAmiibos_byNonExistingGameCharacterKey() async throws { + @Test + func `get Amiibo items by a non-existing game character key`() async throws { // GIVEN let key = "0xf9" @@ -423,8 +425,8 @@ struct AmiiboServiceLiveTests { #expect(amiibos.isEmpty) } - @Test("Get Amiibo items by a non-existing game character name") - func getAmiibos_byNonExistingGameCharacterName() async throws { + @Test + func `get Amiibo items by a non-existing game character name`() async throws { // GIVEN let name = "something" @@ -435,8 +437,8 @@ struct AmiiboServiceLiveTests { #expect(amiibos.isEmpty) } - @Test("Get Amiibo items by an incomplete game character key") - func getAmiibos_byIncompleteGameCharacterKey() async throws { + @Test + func `get Amiibo items by an incomplete game character key`() async throws { // GIVEN let key = "0x" @@ -447,8 +449,8 @@ struct AmiiboServiceLiveTests { } } - @Test("Get Amiibo items by an incomplete game character name") - func getAmiibos_byIncompleteGameCharacterName() async throws { + @Test + func `get Amiibo items by an incomplete game character name`() async throws { // GIVEN let name = "fig" @@ -459,8 +461,8 @@ struct AmiiboServiceLiveTests { #expect(amiibos.isEmpty) } - @Test("Get Amiibo items by an empty game character key") - func getAmiibos_byEmptyGameCharacterKey() async throws { + @Test + func `get Amiibo items by an empty game character key`() async throws { // GIVEN let key = "" @@ -469,11 +471,11 @@ struct AmiiboServiceLiveTests { // THEN #expect(!amiibos.isEmpty) - #expect(amiibos.count == 853) + #expect(amiibos.count == 885) } - @Test("Get Amiibo items by an empty game character name") - func getAmiibos_byEmptyGameCharacterName() async throws { + @Test + func `get Amiibo items by an empty game character name`() async throws { // GIVEN let name = "" @@ -482,11 +484,11 @@ struct AmiiboServiceLiveTests { // THEN #expect(!amiibos.isEmpty) - #expect(amiibos.count == 853) + #expect(amiibos.count == 885) } - @Test("Get Amiibo items by an existing game series key") - func getAmiibos_byExistingGameSeriesKey() async throws { + @Test + func `get Amiibo items by an existing game series key`() async throws { // GIVEN let key = "0x00" @@ -495,15 +497,15 @@ struct AmiiboServiceLiveTests { // THEN #expect(!amiibos.isEmpty) - #expect(amiibos.count == 42) + #expect(amiibos.count == 45) #expect(amiibos.first?.gameSeries == "Super Mario") #expect(amiibos.first?.platform == nil) #expect(amiibos.last?.gameSeries == "Super Mario") #expect(amiibos.last?.platform == nil) } - @Test("Get Amiibo items by an existing game series name") - func getAmiibos_byExistingGameSeriesName() async throws { + @Test + func `get Amiibo items by an existing game series name`() async throws { // GIVEN let name = "The Legend of Zelda" @@ -512,15 +514,15 @@ struct AmiiboServiceLiveTests { // THEN #expect(!amiibos.isEmpty) - #expect(amiibos.count == 28) + #expect(amiibos.count == 32) #expect(amiibos.first?.gameSeries == name) #expect(amiibos.first?.platform == nil) #expect(amiibos.last?.gameSeries == name) #expect(amiibos.last?.platform == nil) } - @Test("Get Amiibo items by a non-existing game series key") - func getAmiibos_byNonExistingGameSeriesKey() async throws { + @Test + func `get Amiibo items by a non-existing game series key`() async throws { // GIVEN let key = "0xf9" @@ -531,8 +533,8 @@ struct AmiiboServiceLiveTests { #expect(amiibos.isEmpty) } - @Test("Get Amiibo items by a non-existing game series name") - func getAmiibos_byNonExistingGameSeriesName() async throws { + @Test + func `get Amiibo items by a non-existing game series name`() async throws { // GIVEN let name = "something" @@ -543,8 +545,8 @@ struct AmiiboServiceLiveTests { #expect(amiibos.isEmpty) } - @Test("Get Amiibo items by an incomplete game series key") - func getAmiibos_byIncompleteGameSeriesKey() async throws { + @Test + func `get Amiibo items by an incomplete game series key`() async throws { // GIVEN let key = "0x" @@ -555,8 +557,8 @@ struct AmiiboServiceLiveTests { } } - @Test("Get Amiibo items by an incomplete game series name") - func getAmiibos_byIncompleteGameSeriesName() async throws { + @Test + func `get Amiibo items by an incomplete game series name`() async throws { // GIVEN let name = "Super" @@ -565,11 +567,11 @@ struct AmiiboServiceLiveTests { // THEN #expect(!amiibos.isEmpty) - #expect(amiibos.count == 140) + #expect(amiibos.count == 143) } - @Test("Get Amiibo items by an empty game series key") - func getAmiibos_byEmptyGameSeriesKey() async throws { + @Test + func `get Amiibo items by an empty game series key`() async throws { // GIVEN let key = "" @@ -578,11 +580,11 @@ struct AmiiboServiceLiveTests { // THEN #expect(!amiibos.isEmpty) - #expect(amiibos.count == 853) + #expect(amiibos.count == 885) } - @Test("Get Amiibo items by an empty game series name") - func getAmiibos_byEmptyGameSeriesName() async throws { + @Test + func `get Amiibo items by an empty game series name`() async throws { // GIVEN let name = "" @@ -591,18 +593,18 @@ struct AmiiboServiceLiveTests { // THEN #expect(!amiibos.isEmpty) - #expect(amiibos.count == 853) + #expect(amiibos.count == 885) } - @Test("Get Amiibo items with games data") - func getAmiibos_withGamesData() async throws { + @Test + func `get Amiibo items with games data`() async throws { // GIVEN // WHEN let amiibos = try await service.getAmiibos(.init(showGames: true)) // THEN #expect(!amiibos.isEmpty) - #expect(amiibos.count == 853) + #expect(amiibos.count == 885) #expect(amiibos.first?.platform != nil) #expect(amiibos.first?.platform?.switch.isEmpty == false) #expect(amiibos.first?.platform?.switch.first?.usages == nil) @@ -613,15 +615,15 @@ struct AmiiboServiceLiveTests { #expect(amiibos.last?.platform != nil) } - @Test("Get Amiibo items with games and usages data") - func getAmiibos_withGamesAndUsagesData() async throws { + @Test + func `get Amiibo items with games and usages data`() async throws { // GIVEN // WHEN let amiibos = try await service.getAmiibos(.init(showUsage: true)) // THEN #expect(!amiibos.isEmpty) - #expect(amiibos.count == 853) + #expect(amiibos.count == 885) #expect(amiibos.first?.platform != nil) #expect(amiibos.first?.platform?.switch.isEmpty == false) #expect(amiibos.first?.platform?.switch.first?.usages?.isEmpty == false) @@ -632,21 +634,21 @@ struct AmiiboServiceLiveTests { #expect(amiibos.last?.platform != nil) } - @Test("Get Amiibo series") - func getAmiiboSeries() async throws { + @Test + func `get Amiibo series`() async throws { // GIVEN // WHEN let amiiboSeries = try await service.getAmiiboSeries() // THEN #expect(!amiiboSeries.isEmpty) - #expect(amiiboSeries.count == 26) + #expect(amiiboSeries.count == 28) #expect(amiiboSeries.first?.key == "0x00") #expect(amiiboSeries.last?.key == "0xff") } - @Test("Get Amiibo series by an existing key") - func getAmiiboSeries_byExistingKey() async throws { + @Test + func `get Amiibo series by an existing key`() async throws { // GIVEN let key = "0x01" @@ -659,8 +661,8 @@ struct AmiiboServiceLiveTests { #expect(amiiboSeries.first?.key == key) } - @Test("Get Amiibo series by a non-existing key") - func getAmiiboSeries_byNonExistingKey() async throws { + @Test + func `get Amiibo series by a non-existing key`() async throws { // GIVEN let key = "0xf9" @@ -671,8 +673,8 @@ struct AmiiboServiceLiveTests { } } - @Test("Get Amiibo series by an incomplete key") - func getAmiiboSeries_byIncompleteKey() async throws { + @Test + func `get Amiibo series by an incomplete key`() async throws { // GIVEN let key = "0x" @@ -683,8 +685,8 @@ struct AmiiboServiceLiveTests { } } - @Test("Get Amiibo series by an empty key") - func getAmiiboSeries_byEmptyKey() async throws { + @Test + func `get Amiibo series by an empty key`() async throws { // GIVEN let key = "" @@ -695,8 +697,8 @@ struct AmiiboServiceLiveTests { } } - @Test("Get Amiibo series by an existing name") - func getAmiiboSeries_byExistingName() async throws { + @Test + func `get Amiibo series by an existing name`() async throws { // GIVEN let name = "Legend Of Zelda" @@ -709,8 +711,8 @@ struct AmiiboServiceLiveTests { #expect(amiiboSeries.first?.name == name) } - @Test("Get Amiibo series by a non-existing name") - func getAmiiboSeries_byNonExistingName() async throws { + @Test + func `get Amiibo series by a non-existing name`() async throws { // GIVEN let name = "Something" @@ -721,8 +723,8 @@ struct AmiiboServiceLiveTests { } } - @Test("Get Amiibo series by an incomplete name") - func getAmiiboSeries_byIncompleteName() async throws { + @Test + func `get Amiibo series by an incomplete name`() async throws { // GIVEN let name = "Zelda" @@ -738,8 +740,8 @@ struct AmiiboServiceLiveTests { #expect(amiiboSeriesName.name.contains(name)) } - @Test("Get Amiibo series by an empty name") - func getAmiiboSeries_byEmptyName() async throws { + @Test + func `get Amiibo series by an empty name`() async throws { // GIVEN let name = "" @@ -748,13 +750,13 @@ struct AmiiboServiceLiveTests { // THEN #expect(!amiiboSeries.isEmpty) - #expect(amiiboSeries.count == 26) + #expect(amiiboSeries.count == 28) #expect(amiiboSeries.first?.key == "0x00") #expect(amiiboSeries.last?.key == "0xff") } - @Test("Get Amiibo types") - func getAmiiboTypes() async throws { + @Test + func `get Amiibo types`() async throws { // GIVEN // WHEN let amiiboTypes = try await service.getAmiiboTypes() @@ -766,8 +768,8 @@ struct AmiiboServiceLiveTests { #expect(amiiboTypes.last?.key == "0x03") } - @Test("Get Amiibo types by an existing key") - func getAmiiboTypes_byExistingKey() async throws { + @Test + func `get Amiibo types by an existing key`() async throws { // GIVEN let key = "0x01" @@ -780,8 +782,8 @@ struct AmiiboServiceLiveTests { #expect(amiiboTypes.first?.key == key) } - @Test("Get Amiibo types by a non-existing key") - func getAmiiboTypes_byNonExistingKey() async throws { + @Test + func `get Amiibo types by a non-existing key`() async throws { // GIVEN let key = "0x09" @@ -792,8 +794,8 @@ struct AmiiboServiceLiveTests { } } - @Test("Get Amiibo types by an incomplete key") - func getAmiiboTypes_byIncompleteKey() async throws { + @Test + func `get Amiibo types by an incomplete key`() async throws { // GIVEN let key = "0x" @@ -804,8 +806,8 @@ struct AmiiboServiceLiveTests { } } - @Test("Get Amiibo types by an empty key") - func getAmiiboTypes_byEmptyKey() async throws { + @Test + func `get Amiibo types by an empty key`() async throws { // GIVEN let key = "" @@ -816,8 +818,8 @@ struct AmiiboServiceLiveTests { } } - @Test("Get Amiibo types by an existing name") - func getAmiiboTypes_byExistingName() async throws { + @Test + func `get Amiibo types by an existing name`() async throws { // GIVEN let name = "Card" @@ -830,8 +832,8 @@ struct AmiiboServiceLiveTests { #expect(amiiboTypes.first?.name == name) } - @Test("Get Amiibo types by a non-existing name") - func getAmiiboTypes_byNonExistingName() async throws { + @Test + func `get Amiibo types by a non-existing name`() async throws { // GIVEN let name = "Something" @@ -842,8 +844,8 @@ struct AmiiboServiceLiveTests { } } - @Test("Get Amiibo types by an incomplete name") - func getAmiiboTypes_byIncompleteName() async throws { + @Test + func `get Amiibo types by an incomplete name`() async throws { // GIVEN let name = "Ca" @@ -859,8 +861,8 @@ struct AmiiboServiceLiveTests { #expect(amiiboTypeName.name.contains(name)) } - @Test("Get Amiibo types by an empty name") - func getAmiiboTypes_byEmptyName() async throws { + @Test + func `get Amiibo types by an empty name`() async throws { // GIVEN let name = "" @@ -874,21 +876,21 @@ struct AmiiboServiceLiveTests { #expect(amiiboTypes.last?.key == "0x03") } - @Test("Get game characters") - func getGameCharacters() async throws { + @Test + func `get Game characters`() async throws { // GIVEN // WHEN let gameCharacters = try await service.getGameCharacters() // THEN #expect(!gameCharacters.isEmpty) - #expect(gameCharacters.count == 644) + #expect(gameCharacters.count == 668) #expect(gameCharacters.first?.key == "0x0000") #expect(gameCharacters.last?.key == "0x3f00") } - @Test("Get game characters by an existing key") - func getGameCharacters_byExistingKey() async throws { + @Test + func `get Game characters by an existing key`() async throws { // GIVEN let key = "0x0001" @@ -901,8 +903,8 @@ struct AmiiboServiceLiveTests { #expect(gameCharacters.first?.key == key) } - @Test("Get game characters by a non-existing key") - func getGameCharacters_byNonExistingKey() async throws { + @Test + func `get Game characters by a non-existing key`() async throws { // GIVEN let key = "0xffff" @@ -913,8 +915,8 @@ struct AmiiboServiceLiveTests { } } - @Test("Get game characters by an incomplete key") - func getGameCharacters_byIncompleteKey() async throws { + @Test + func `get Game characters by an incomplete key`() async throws { // GIVEN let key = "0x" @@ -925,8 +927,8 @@ struct AmiiboServiceLiveTests { } } - @Test("Get game characters by an empty key") - func getGameCharacters_byEmptyKey() async throws { + @Test + func `get Game characters by an empty key`() async throws { // GIVEN let key = "" @@ -937,8 +939,8 @@ struct AmiiboServiceLiveTests { } } - @Test("Get game characters by an existing name") - func getGameCharacters_byExistingName() async throws { + @Test + func `get Game characters by an existing name`() async throws { // GIVEN let name = "Zelda" @@ -951,8 +953,8 @@ struct AmiiboServiceLiveTests { #expect(gameCharacters.first?.name == name) } - @Test("Get game characters by a non-existing name") - func getGameCharacters_byNonExistingName() async throws { + @Test + func `get Game characters by a non-existing name`() async throws { // GIVEN let name = "Something" @@ -963,8 +965,8 @@ struct AmiiboServiceLiveTests { } } - @Test("Get game characters by an incomplete name") - func getGameCharacters_byIncompleteName() async throws { + @Test + func `get Game characters by an incomplete name`() async throws { // GIVEN let name = "Zeld" @@ -980,8 +982,8 @@ struct AmiiboServiceLiveTests { #expect(gameCharactersName.name.contains(name)) } - @Test("Get game characters by an empty name") - func getGameCharacters_byEmptyName() async throws { + @Test + func `get Game characters by an empty name`() async throws { // GIVEN let name = "" @@ -990,26 +992,26 @@ struct AmiiboServiceLiveTests { // THEN #expect(!gameCharacters.isEmpty) - #expect(gameCharacters.count == 644) + #expect(gameCharacters.count == 668) #expect(gameCharacters.first?.key == "0x0000") #expect(gameCharacters.last?.key == "0x3f00") } - @Test("Get game series") - func getGameSeries() async throws { + @Test + func `get Game series`() async throws { // GIVEN // WHEN let gameSeries = try await service.getGameSeries() // THEN #expect(!gameSeries.isEmpty) - #expect(gameSeries.count == 116) + #expect(gameSeries.count == 117) #expect(gameSeries.first?.key == "0x000") #expect(gameSeries.last?.key == "0x3f0") } - @Test("Get game series by an existing key") - func getGameSeries_byExistingKey() async throws { + @Test + func `get Game series by an existing key`() async throws { // GIVEN let key = "0x001" @@ -1022,8 +1024,8 @@ struct AmiiboServiceLiveTests { #expect(gameSeries.first?.key == key) } - @Test("Get game series by a non-existing key") - func getGameSeries_byNonExistingKey() async throws { + @Test + func `get Game Series by a non-existing key`() async throws { // GIVEN let key = "0xffff" @@ -1034,8 +1036,8 @@ struct AmiiboServiceLiveTests { } } - @Test("Get game series by an incomplete key") - func getGameSeries_byIncompleteKey() async throws { + @Test + func `get Game series by an incomplete key`() async throws { // GIVEN let key = "0x" @@ -1045,8 +1047,8 @@ struct AmiiboServiceLiveTests { } } - @Test("Get game series by an empty key") - func getGameSeries_byEmptyKey() async throws { + @Test + func `get Game series by an empty key`() async throws { // GIVEN let key = "" @@ -1057,8 +1059,8 @@ struct AmiiboServiceLiveTests { } } - @Test("Get game series by an existing name") - func getGameSeries_byExistingName() async throws { + @Test + func `get Game series by an existing name`() async throws { // GIVEN let name = "Pikmin" @@ -1071,8 +1073,8 @@ struct AmiiboServiceLiveTests { #expect(gameSeries.first?.name == name) } - @Test("Get game series by a non-existing name") - func getGameSeries_byNonExistingName() async throws { + @Test + func `get Game series by a non-existing name`() async throws { // GIVEN let name = "Something" @@ -1083,8 +1085,8 @@ struct AmiiboServiceLiveTests { } } - @Test("Get game series by an incomplete name") - func getGameSeries_byIncompleteName() async throws { + @Test + func `get Game series by an incomplete name`() async throws { // GIVEN let name = "Pik" @@ -1100,8 +1102,8 @@ struct AmiiboServiceLiveTests { #expect(gameSeriesName.name.contains(name)) } - @Test("Get game series by an empty name") - func getGameSeries_byEmptyName() async throws { + @Test + func `get Game series by an empty name`() async throws { // GIVEN let name = "" @@ -1110,13 +1112,13 @@ struct AmiiboServiceLiveTests { // THEN #expect(!gameSeries.isEmpty) - #expect(gameSeries.count == 116) + #expect(gameSeries.count == 117) #expect(gameSeries.first?.key == "0x000") #expect(gameSeries.last?.key == "0x3f0") } - @Test("Get the last updated timestamp") - func getLastUpdated() async throws { + @Test + func `get the Last Updated timestamp`() async throws { // GIVEN // WHEN let dateLastUpdated = try await service.getLastUpdated() @@ -1127,9 +1129,9 @@ struct AmiiboServiceLiveTests { from: dateLastUpdated ) - #expect(dateComponents.year == 2024) - #expect(dateComponents.month == 9) - #expect(dateComponents.day == 6) + #expect(dateComponents.year == 2025) + #expect(dateComponents.month == 7) + #expect(dateComponents.day == 18) } }