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: #3
Co-authored-by: Javier Cicchelli <javier@rock-n-code.com>
Co-committed-by: Javier Cicchelli <javier@rock-n-code.com>
This commit was merged in pull request #3.
This commit is contained in:
2025-09-09 17:20:05 +00:00
committed by Javier Cicchelli
parent da07ef7e4f
commit 39c6d6e8d6
30 changed files with 258 additions and 284 deletions
+2 -2
View File
@@ -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. # Licensed under the EUPL 1.2 or later.
# #
# See LICENSE for license information # See LICENSE for license information
+12 -12
View File
@@ -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. // Licensed under the EUPL 1.2 or later.
// //
// See LICENSE for license information // See LICENSE for license information
@@ -15,7 +15,7 @@
import PackageDescription import PackageDescription
let package = Package( let package = Package(
name: AmiiboAPI.package, name: AmiiboService.package,
platforms: [ platforms: [
.iOS(.v13), .iOS(.v13),
.macOS(.v10_15), .macOS(.v10_15),
@@ -25,9 +25,9 @@ let package = Package(
], ],
products: [ products: [
.library( .library(
name: AmiiboAPI.package, name: AmiiboService.package,
targets: [ targets: [
AmiiboAPI.target AmiiboService.target
] ]
) )
], ],
@@ -47,7 +47,7 @@ let package = Package(
], ],
targets: [ targets: [
.target( .target(
name: AmiiboAPI.target, name: AmiiboService.target,
dependencies: [ dependencies: [
.product( .product(
name: "OpenAPIRuntime", name: "OpenAPIRuntime",
@@ -67,9 +67,9 @@ let package = Package(
] ]
), ),
.testTarget( .testTarget(
name: AmiiboAPI.test, name: AmiiboService.test,
dependencies: [ dependencies: [
.byName(name: AmiiboAPI.target) .byName(name: AmiiboService.target)
], ],
path: "Tests" path: "Tests"
), ),
@@ -78,8 +78,8 @@ let package = Package(
// MARK: - Constants // MARK: - Constants
enum AmiiboAPI { enum AmiiboService {
static let package = "amiibo-api" static let package = "amiibo-service"
static let target = "AmiiboAPI" static let target = "AmiiboService"
static let test = "\(AmiiboAPI.target)Tests" static let test = "\(AmiiboService.target)Tests"
} }
+1 -1
View File
@@ -1 +1 @@
# Amiibo API # Amiibo Service
@@ -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()
)
}
}
}
@@ -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. // Licensed under the EUPL 1.2 or later.
// //
// See LICENSE for license information // See LICENSE for license information
+2 -2
View File
@@ -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. // Licensed under the EUPL 1.2 or later.
// //
// See LICENSE for license information // See LICENSE for license information
@@ -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. // Licensed under the EUPL 1.2 or later.
// //
// See LICENSE for license information // See LICENSE for license information
@@ -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. // Licensed under the EUPL 1.2 or later.
// //
// See LICENSE for license information // See LICENSE for license information
@@ -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. // Licensed under the EUPL 1.2 or later.
// //
// See LICENSE for license information // See LICENSE for license information
@@ -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. // Licensed under the EUPL 1.2 or later.
// //
// See LICENSE for license information // See LICENSE for license information
@@ -24,7 +24,7 @@ public struct AmiiboLiveClient {
public init() throws { public init() throws {
self.client = .init( self.client = .init(
serverURL: try Servers.server1(), serverURL: try Servers.Server1.url(),
configuration: .init(dateTranscoder: ISODateTranscoder()), configuration: .init(dateTranscoder: ISODateTranscoder()),
transport: URLSessionTransport() transport: URLSessionTransport()
) )
@@ -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. // Licensed under the EUPL 1.2 or later.
// //
// See LICENSE for license information // See LICENSE for license information
@@ -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. // Licensed under the EUPL 1.2 or later.
// //
// See LICENSE for license information // See LICENSE for license information
+2 -2
View File
@@ -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. // Licensed under the EUPL 1.2 or later.
// //
// See LICENSE for license information // See LICENSE for license information
@@ -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. // Licensed under the EUPL 1.2 or later.
// //
// See LICENSE for license information // See LICENSE for license information
@@ -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. // Licensed under the EUPL 1.2 or later.
// //
// See LICENSE for license information // See LICENSE for license information
@@ -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. // Licensed under the EUPL 1.2 or later.
// //
// See LICENSE for license information // See LICENSE for license information
@@ -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. // Licensed under the EUPL 1.2 or later.
// //
// See LICENSE for license information // See LICENSE for license information
+2 -2
View File
@@ -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. // Licensed under the EUPL 1.2 or later.
// //
// See LICENSE for license information // See LICENSE for license information
@@ -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. // Licensed under the EUPL 1.2 or later.
// //
// See LICENSE for license information // See LICENSE for license information
@@ -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. // Licensed under the EUPL 1.2 or later.
// //
// See LICENSE for license information // See LICENSE for license information
@@ -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. // Licensed under the EUPL 1.2 or later.
// //
// See LICENSE for license information // See LICENSE for license information
@@ -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. // Licensed under the EUPL 1.2 or later.
// //
// See LICENSE for license information // See LICENSE for license information
+2 -2
View File
@@ -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. // Licensed under the EUPL 1.2 or later.
// //
// See LICENSE for license information // See LICENSE for license information
+2 -2
View File
@@ -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. // Licensed under the EUPL 1.2 or later.
// //
// See LICENSE for license information // See LICENSE for license information
+2 -2
View File
@@ -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. // Licensed under the EUPL 1.2 or later.
// //
// See LICENSE for license information // See LICENSE for license information
+2 -2
View File
@@ -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. // Licensed under the EUPL 1.2 or later.
// //
// See LICENSE for license information // See LICENSE for license information
+2 -2
View File
@@ -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. // Licensed under the EUPL 1.2 or later.
// //
// See LICENSE for license information // See LICENSE for license information
+3 -2
View File
@@ -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. # Licensed under the EUPL 1.2 or later.
# #
# See LICENSE for license information # See LICENSE for license information
@@ -13,4 +13,5 @@
generate: generate:
- types - types
- client - client
namingStrategy: defensive
accessModifier: internal accessModifier: internal
+2 -2
View File
@@ -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. # Licensed under the EUPL 1.2 or later.
# #
# See LICENSE for license information # See LICENSE for license information
+191 -189
View File
@@ -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. // Licensed under the EUPL 1.2 or later.
// //
// See LICENSE for license information // See LICENSE for license information
@@ -10,10 +10,11 @@
// //
//===----------------------------------------------------------------------=== //===----------------------------------------------------------------------===
import AmiiboAPI import AmiiboService
import Foundation import Foundation
import Testing import Testing
@Suite("Live service")
struct AmiiboServiceLiveTests { struct AmiiboServiceLiveTests {
// MARK: Properties // MARK: Properties
@@ -30,23 +31,23 @@ struct AmiiboServiceLiveTests {
// MARK: Functions tests // MARK: Functions tests
@Test("Get Amiibo items") @Test
func getAmiibos() async throws { func `get Amiibo items`() async throws {
// GIVEN // GIVEN
// WHEN // WHEN
let amiibos = try await service.getAmiibos() let amiibos = try await service.getAmiibos()
// THEN // THEN
#expect(!amiibos.isEmpty) #expect(!amiibos.isEmpty)
#expect(amiibos.count == 853) #expect(amiibos.count == 885)
#expect(amiibos.first?.identifier == "0000000000000002") #expect(amiibos.first?.identifier == "0000000000000002")
#expect(amiibos.first?.platform == nil) #expect(amiibos.first?.platform == nil)
#expect(amiibos.last?.identifier == "3f000000042e0002") #expect(amiibos.last?.identifier == "3f000000042e0002")
#expect(amiibos.last?.platform == nil) #expect(amiibos.last?.platform == nil)
} }
@Test("Get Amiibo items by an existing identifier") @Test
func getAmiibos_byExistingIdentifier() async throws { func `get Amiibo items by an existing identifier`() async throws {
// GIVEN // GIVEN
let identifier = "0000000000000002" let identifier = "0000000000000002"
@@ -60,8 +61,8 @@ struct AmiiboServiceLiveTests {
#expect(amiibos.first?.platform == nil) #expect(amiibos.first?.platform == nil)
} }
@Test("Get Amiibo items by a non-existing identifier") @Test
func getAmiibos_byNonExistingIdentifier() async throws { func `get Amiibo items by a non-existing identifier`() async throws {
// GIVEN // GIVEN
let identifier = "0000000000000000" let identifier = "0000000000000000"
@@ -72,8 +73,8 @@ struct AmiiboServiceLiveTests {
} }
} }
@Test("Get Amiibo items by an incomplete identifier") @Test
func getAmiibos_byIncompleteIdentifier() async throws { func `get Amiibo items by an incomplete identifier`() async throws {
// GIVEN // GIVEN
let identifier = "0000000" let identifier = "0000000"
@@ -84,8 +85,8 @@ struct AmiiboServiceLiveTests {
} }
} }
@Test("Get Amiibo items by an empty identifier") @Test
func getAmiibos_byEmptyIdentifier() async throws { func `get Amiibo items by an empty identifier`() async throws {
// GIVEN // GIVEN
let identifier = "" let identifier = ""
@@ -96,8 +97,8 @@ struct AmiiboServiceLiveTests {
} }
} }
@Test("Get Amiibo items by an existing name") @Test
func getAmiibos_byExistingName() async throws { func `get Amiibo items by an existing name`() async throws {
// GIVEN // GIVEN
let name = "zelda" let name = "zelda"
@@ -117,8 +118,8 @@ struct AmiiboServiceLiveTests {
#expect(nameLast.contains(name)) #expect(nameLast.contains(name))
} }
@Test("Get Amiibo items by a non-existing name") @Test
func getAmiibos_byNonExistingName() async throws { func `get Amiibo items by a non-existing name`() async throws {
// GIVEN // GIVEN
let name = "Something" let name = "Something"
@@ -129,8 +130,8 @@ struct AmiiboServiceLiveTests {
#expect(amiibos.isEmpty) #expect(amiibos.isEmpty)
} }
@Test("Get Amiibo items by an incomplete name") @Test
func getAmiibos_byIncompleteName() async throws { func `get Amiibo items by an incomplete name`() async throws {
// GIVEN // GIVEN
let name = "zel" let name = "zel"
@@ -150,8 +151,8 @@ struct AmiiboServiceLiveTests {
#expect(nameLast.contains(name)) #expect(nameLast.contains(name))
} }
@Test("Get Amiibo items by an empty name") @Test
func getAmiibos_byEmptyName() async throws { func `get Amiibo items by an empty name`() async throws {
// GIVEN // GIVEN
let name = "" let name = ""
@@ -160,11 +161,11 @@ struct AmiiboServiceLiveTests {
// THEN // THEN
#expect(!amiibos.isEmpty) #expect(!amiibos.isEmpty)
#expect(amiibos.count == 853) #expect(amiibos.count == 885)
} }
@Test("Get Amiibo items by an existing type key") @Test
func getAmiibos_byExistingTypeKey() async throws { func `get Amiibo items by an existing type key`() async throws {
// GIVEN // GIVEN
let key = "0x00" let key = "0x00"
@@ -173,15 +174,15 @@ struct AmiiboServiceLiveTests {
// THEN // THEN
#expect(!amiibos.isEmpty) #expect(!amiibos.isEmpty)
#expect(amiibos.count == 227) #expect(amiibos.count == 235)
#expect(amiibos.first?.type == "Figure") #expect(amiibos.first?.type == "Figure")
#expect(amiibos.first?.platform == nil) #expect(amiibos.first?.platform == nil)
#expect(amiibos.last?.type == "Figure") #expect(amiibos.last?.type == "Figure")
#expect(amiibos.last?.platform == nil) #expect(amiibos.last?.platform == nil)
} }
@Test("Get Amiibo items by an existing type name") @Test
func getAmiibos_byExistingTypeName() async throws { func `get Amiibo items by an existing type name`() async throws {
// GIVEN // GIVEN
let name = "figure" let name = "figure"
@@ -190,15 +191,15 @@ struct AmiiboServiceLiveTests {
// THEN // THEN
#expect(!amiibos.isEmpty) #expect(!amiibos.isEmpty)
#expect(amiibos.count == 227) #expect(amiibos.count == 235)
#expect(amiibos.first?.type == "Figure") #expect(amiibos.first?.type == "Figure")
#expect(amiibos.first?.platform == nil) #expect(amiibos.first?.platform == nil)
#expect(amiibos.last?.type == "Figure") #expect(amiibos.last?.type == "Figure")
#expect(amiibos.last?.platform == nil) #expect(amiibos.last?.platform == nil)
} }
@Test("Get Amiibo items by a non-existing type key") @Test
func getAmiibos_byNonExistingTypeKey() async throws { func `get Amiibo items by a non-existing type key`() async throws {
// GIVEN // GIVEN
let key = "0x0f" let key = "0x0f"
@@ -209,8 +210,8 @@ struct AmiiboServiceLiveTests {
#expect(amiibos.isEmpty) #expect(amiibos.isEmpty)
} }
@Test("Get Amiibo items by a non-existing type name") @Test
func getAmiibos_byNonExistingTypeName() async throws { func `get Amiibo items by a non-existing type name`() async throws {
// GIVEN // GIVEN
let name = "something" let name = "something"
@@ -221,8 +222,8 @@ struct AmiiboServiceLiveTests {
#expect(amiibos.isEmpty) #expect(amiibos.isEmpty)
} }
@Test("Get Amiibo items by an incomplete type key") @Test
func getAmiibos_byIncompleteTypeKey() async throws { func `get Amiibo items by an incomplete type key`() async throws {
// GIVEN // GIVEN
let key = "0x" let key = "0x"
@@ -233,8 +234,8 @@ struct AmiiboServiceLiveTests {
} }
} }
@Test("Get Amiibo items by an incomplete type name") @Test
func getAmiibos_byIncompleteTypeName() async throws { func `get Amiibo items by an incomplete type name`() async throws {
// GIVEN // GIVEN
let name = "fig" let name = "fig"
@@ -245,8 +246,8 @@ struct AmiiboServiceLiveTests {
#expect(amiibos.isEmpty) #expect(amiibos.isEmpty)
} }
@Test("Get Amiibo items by an empty type key") @Test
func getAmiibos_byEmptyTypeKey() async throws { func `get Amiibo items by an empty type key`() async throws {
// GIVEN // GIVEN
let key = "" let key = ""
@@ -257,8 +258,8 @@ struct AmiiboServiceLiveTests {
#expect(amiibos.isEmpty) #expect(amiibos.isEmpty)
} }
@Test("Get Amiibo items by an empty type name") @Test
func getAmiibos_byEmptyTypeName() async throws { func `get Amiibo items by an empty type name`() async throws {
// GIVEN // GIVEN
let name = "" let name = ""
@@ -269,8 +270,8 @@ struct AmiiboServiceLiveTests {
#expect(amiibos.isEmpty) #expect(amiibos.isEmpty)
} }
@Test("Get Amiibo items by an existing series key") @Test
func getAmiibos_byExistingSeriesKey() async throws { func `get Amiibo items by an existing series key`() async throws {
// GIVEN // GIVEN
let key = "0x00" let key = "0x00"
@@ -286,8 +287,8 @@ struct AmiiboServiceLiveTests {
#expect(amiibos.last?.platform == nil) #expect(amiibos.last?.platform == nil)
} }
@Test("Get Amiibo items by an existing series name") @Test
func getAmiibos_byExistingSeriesName() async throws { func `get Amiibo items by an existing series name`() async throws {
// GIVEN // GIVEN
let name = "Legend Of Zelda" let name = "Legend Of Zelda"
@@ -296,15 +297,15 @@ struct AmiiboServiceLiveTests {
// THEN // THEN
#expect(!amiibos.isEmpty) #expect(!amiibos.isEmpty)
#expect(amiibos.count == 22) #expect(amiibos.count == 26)
#expect(amiibos.first?.series == name) #expect(amiibos.first?.series == name)
#expect(amiibos.first?.platform == nil) #expect(amiibos.first?.platform == nil)
#expect(amiibos.last?.series == name) #expect(amiibos.last?.series == name)
#expect(amiibos.last?.platform == nil) #expect(amiibos.last?.platform == nil)
} }
@Test("Get Amiibo items by a non-existing series key") @Test
func getAmiibos_byNonExistingSeriesKey() async throws { func `get Amiibo items by a non-existing series key`() async throws {
// GIVEN // GIVEN
let key = "0xf9" let key = "0xf9"
@@ -315,8 +316,8 @@ struct AmiiboServiceLiveTests {
#expect(amiibos.isEmpty) #expect(amiibos.isEmpty)
} }
@Test("Get Amiibo items by a non-existing series name") @Test
func getAmiibos_byNonExistingSeriesName() async throws { func `get Amiibo items by a non-existing series name`() async throws {
// GIVEN // GIVEN
let name = "something" let name = "something"
@@ -327,8 +328,8 @@ struct AmiiboServiceLiveTests {
#expect(amiibos.isEmpty) #expect(amiibos.isEmpty)
} }
@Test("Get Amiibo items by an incomplete series key") @Test
func getAmiibos_byIncompleteSeriesKey() async throws { func `get Amiibo items by an incomplete series key`() async throws {
// GIVEN // GIVEN
let key = "0x" let key = "0x"
@@ -339,8 +340,8 @@ struct AmiiboServiceLiveTests {
} }
} }
@Test("Get Amiibo items by an incomplete series name") @Test
func getAmiibos_byIncompleteSeriesName() async throws { func `get Amiibo items by an incomplete series name`() async throws {
// GIVEN // GIVEN
let name = "fig" let name = "fig"
@@ -348,11 +349,12 @@ struct AmiiboServiceLiveTests {
let amiibos = try await service.getAmiibos(.init(series: name)) let amiibos = try await service.getAmiibos(.init(series: name))
// THEN // THEN
#expect(amiibos.isEmpty) #expect(!amiibos.isEmpty)
#expect(amiibos.count == 25)
} }
@Test("Get Amiibo items by an empty series key") @Test
func getAmiibos_byEmptySeriesKey() async throws { func `get Amiibo items by an empty series key`() async throws {
// GIVEN // GIVEN
let key = "" let key = ""
@@ -361,11 +363,11 @@ struct AmiiboServiceLiveTests {
// THEN // THEN
#expect(!amiibos.isEmpty) #expect(!amiibos.isEmpty)
#expect(amiibos.count == 853) #expect(amiibos.count == 885)
} }
@Test("Get Amiibo items by an empty series name") @Test
func getAmiibos_byEmptySeriesName() async throws { func `get Amiibo items by an empty series name`() async throws {
// GIVEN // GIVEN
let name = "" let name = ""
@@ -374,11 +376,11 @@ struct AmiiboServiceLiveTests {
// THEN // THEN
#expect(!amiibos.isEmpty) #expect(!amiibos.isEmpty)
#expect(amiibos.count == 853) #expect(amiibos.count == 885)
} }
@Test("Get Amiibo items by an existing game character key") @Test
func getAmiibos_byExistingGameCharacterKey() async throws { func `get Amiibo items by an existing game character key`() async throws {
// GIVEN // GIVEN
let key = "0x00" let key = "0x00"
@@ -394,8 +396,8 @@ struct AmiiboServiceLiveTests {
#expect(amiibos.last?.platform == nil) #expect(amiibos.last?.platform == nil)
} }
@Test("Get Amiibo items by an existing game character name") @Test
func getAmiibos_byExistingGameCharacterName() async throws { func `get Amiibo items by an existing game character name`() async throws {
// GIVEN // GIVEN
let name = "Zelda" let name = "Zelda"
@@ -411,8 +413,8 @@ struct AmiiboServiceLiveTests {
#expect(amiibos.last?.platform == nil) #expect(amiibos.last?.platform == nil)
} }
@Test("Get Amiibo items by a non-existing game character key") @Test
func getAmiibos_byNonExistingGameCharacterKey() async throws { func `get Amiibo items by a non-existing game character key`() async throws {
// GIVEN // GIVEN
let key = "0xf9" let key = "0xf9"
@@ -423,8 +425,8 @@ struct AmiiboServiceLiveTests {
#expect(amiibos.isEmpty) #expect(amiibos.isEmpty)
} }
@Test("Get Amiibo items by a non-existing game character name") @Test
func getAmiibos_byNonExistingGameCharacterName() async throws { func `get Amiibo items by a non-existing game character name`() async throws {
// GIVEN // GIVEN
let name = "something" let name = "something"
@@ -435,8 +437,8 @@ struct AmiiboServiceLiveTests {
#expect(amiibos.isEmpty) #expect(amiibos.isEmpty)
} }
@Test("Get Amiibo items by an incomplete game character key") @Test
func getAmiibos_byIncompleteGameCharacterKey() async throws { func `get Amiibo items by an incomplete game character key`() async throws {
// GIVEN // GIVEN
let key = "0x" let key = "0x"
@@ -447,8 +449,8 @@ struct AmiiboServiceLiveTests {
} }
} }
@Test("Get Amiibo items by an incomplete game character name") @Test
func getAmiibos_byIncompleteGameCharacterName() async throws { func `get Amiibo items by an incomplete game character name`() async throws {
// GIVEN // GIVEN
let name = "fig" let name = "fig"
@@ -459,8 +461,8 @@ struct AmiiboServiceLiveTests {
#expect(amiibos.isEmpty) #expect(amiibos.isEmpty)
} }
@Test("Get Amiibo items by an empty game character key") @Test
func getAmiibos_byEmptyGameCharacterKey() async throws { func `get Amiibo items by an empty game character key`() async throws {
// GIVEN // GIVEN
let key = "" let key = ""
@@ -469,11 +471,11 @@ struct AmiiboServiceLiveTests {
// THEN // THEN
#expect(!amiibos.isEmpty) #expect(!amiibos.isEmpty)
#expect(amiibos.count == 853) #expect(amiibos.count == 885)
} }
@Test("Get Amiibo items by an empty game character name") @Test
func getAmiibos_byEmptyGameCharacterName() async throws { func `get Amiibo items by an empty game character name`() async throws {
// GIVEN // GIVEN
let name = "" let name = ""
@@ -482,11 +484,11 @@ struct AmiiboServiceLiveTests {
// THEN // THEN
#expect(!amiibos.isEmpty) #expect(!amiibos.isEmpty)
#expect(amiibos.count == 853) #expect(amiibos.count == 885)
} }
@Test("Get Amiibo items by an existing game series key") @Test
func getAmiibos_byExistingGameSeriesKey() async throws { func `get Amiibo items by an existing game series key`() async throws {
// GIVEN // GIVEN
let key = "0x00" let key = "0x00"
@@ -495,15 +497,15 @@ struct AmiiboServiceLiveTests {
// THEN // THEN
#expect(!amiibos.isEmpty) #expect(!amiibos.isEmpty)
#expect(amiibos.count == 42) #expect(amiibos.count == 45)
#expect(amiibos.first?.gameSeries == "Super Mario") #expect(amiibos.first?.gameSeries == "Super Mario")
#expect(amiibos.first?.platform == nil) #expect(amiibos.first?.platform == nil)
#expect(amiibos.last?.gameSeries == "Super Mario") #expect(amiibos.last?.gameSeries == "Super Mario")
#expect(amiibos.last?.platform == nil) #expect(amiibos.last?.platform == nil)
} }
@Test("Get Amiibo items by an existing game series name") @Test
func getAmiibos_byExistingGameSeriesName() async throws { func `get Amiibo items by an existing game series name`() async throws {
// GIVEN // GIVEN
let name = "The Legend of Zelda" let name = "The Legend of Zelda"
@@ -512,15 +514,15 @@ struct AmiiboServiceLiveTests {
// THEN // THEN
#expect(!amiibos.isEmpty) #expect(!amiibos.isEmpty)
#expect(amiibos.count == 28) #expect(amiibos.count == 32)
#expect(amiibos.first?.gameSeries == name) #expect(amiibos.first?.gameSeries == name)
#expect(amiibos.first?.platform == nil) #expect(amiibos.first?.platform == nil)
#expect(amiibos.last?.gameSeries == name) #expect(amiibos.last?.gameSeries == name)
#expect(amiibos.last?.platform == nil) #expect(amiibos.last?.platform == nil)
} }
@Test("Get Amiibo items by a non-existing game series key") @Test
func getAmiibos_byNonExistingGameSeriesKey() async throws { func `get Amiibo items by a non-existing game series key`() async throws {
// GIVEN // GIVEN
let key = "0xf9" let key = "0xf9"
@@ -531,8 +533,8 @@ struct AmiiboServiceLiveTests {
#expect(amiibos.isEmpty) #expect(amiibos.isEmpty)
} }
@Test("Get Amiibo items by a non-existing game series name") @Test
func getAmiibos_byNonExistingGameSeriesName() async throws { func `get Amiibo items by a non-existing game series name`() async throws {
// GIVEN // GIVEN
let name = "something" let name = "something"
@@ -543,8 +545,8 @@ struct AmiiboServiceLiveTests {
#expect(amiibos.isEmpty) #expect(amiibos.isEmpty)
} }
@Test("Get Amiibo items by an incomplete game series key") @Test
func getAmiibos_byIncompleteGameSeriesKey() async throws { func `get Amiibo items by an incomplete game series key`() async throws {
// GIVEN // GIVEN
let key = "0x" let key = "0x"
@@ -555,8 +557,8 @@ struct AmiiboServiceLiveTests {
} }
} }
@Test("Get Amiibo items by an incomplete game series name") @Test
func getAmiibos_byIncompleteGameSeriesName() async throws { func `get Amiibo items by an incomplete game series name`() async throws {
// GIVEN // GIVEN
let name = "Super" let name = "Super"
@@ -565,11 +567,11 @@ struct AmiiboServiceLiveTests {
// THEN // THEN
#expect(!amiibos.isEmpty) #expect(!amiibos.isEmpty)
#expect(amiibos.count == 140) #expect(amiibos.count == 143)
} }
@Test("Get Amiibo items by an empty game series key") @Test
func getAmiibos_byEmptyGameSeriesKey() async throws { func `get Amiibo items by an empty game series key`() async throws {
// GIVEN // GIVEN
let key = "" let key = ""
@@ -578,11 +580,11 @@ struct AmiiboServiceLiveTests {
// THEN // THEN
#expect(!amiibos.isEmpty) #expect(!amiibos.isEmpty)
#expect(amiibos.count == 853) #expect(amiibos.count == 885)
} }
@Test("Get Amiibo items by an empty game series name") @Test
func getAmiibos_byEmptyGameSeriesName() async throws { func `get Amiibo items by an empty game series name`() async throws {
// GIVEN // GIVEN
let name = "" let name = ""
@@ -591,18 +593,18 @@ struct AmiiboServiceLiveTests {
// THEN // THEN
#expect(!amiibos.isEmpty) #expect(!amiibos.isEmpty)
#expect(amiibos.count == 853) #expect(amiibos.count == 885)
} }
@Test("Get Amiibo items with games data") @Test
func getAmiibos_withGamesData() async throws { func `get Amiibo items with games data`() async throws {
// GIVEN // GIVEN
// WHEN // WHEN
let amiibos = try await service.getAmiibos(.init(showGames: true)) let amiibos = try await service.getAmiibos(.init(showGames: true))
// THEN // THEN
#expect(!amiibos.isEmpty) #expect(!amiibos.isEmpty)
#expect(amiibos.count == 853) #expect(amiibos.count == 885)
#expect(amiibos.first?.platform != nil) #expect(amiibos.first?.platform != nil)
#expect(amiibos.first?.platform?.switch.isEmpty == false) #expect(amiibos.first?.platform?.switch.isEmpty == false)
#expect(amiibos.first?.platform?.switch.first?.usages == nil) #expect(amiibos.first?.platform?.switch.first?.usages == nil)
@@ -613,15 +615,15 @@ struct AmiiboServiceLiveTests {
#expect(amiibos.last?.platform != nil) #expect(amiibos.last?.platform != nil)
} }
@Test("Get Amiibo items with games and usages data") @Test
func getAmiibos_withGamesAndUsagesData() async throws { func `get Amiibo items with games and usages data`() async throws {
// GIVEN // GIVEN
// WHEN // WHEN
let amiibos = try await service.getAmiibos(.init(showUsage: true)) let amiibos = try await service.getAmiibos(.init(showUsage: true))
// THEN // THEN
#expect(!amiibos.isEmpty) #expect(!amiibos.isEmpty)
#expect(amiibos.count == 853) #expect(amiibos.count == 885)
#expect(amiibos.first?.platform != nil) #expect(amiibos.first?.platform != nil)
#expect(amiibos.first?.platform?.switch.isEmpty == false) #expect(amiibos.first?.platform?.switch.isEmpty == false)
#expect(amiibos.first?.platform?.switch.first?.usages?.isEmpty == false) #expect(amiibos.first?.platform?.switch.first?.usages?.isEmpty == false)
@@ -632,21 +634,21 @@ struct AmiiboServiceLiveTests {
#expect(amiibos.last?.platform != nil) #expect(amiibos.last?.platform != nil)
} }
@Test("Get Amiibo series") @Test
func getAmiiboSeries() async throws { func `get Amiibo series`() async throws {
// GIVEN // GIVEN
// WHEN // WHEN
let amiiboSeries = try await service.getAmiiboSeries() let amiiboSeries = try await service.getAmiiboSeries()
// THEN // THEN
#expect(!amiiboSeries.isEmpty) #expect(!amiiboSeries.isEmpty)
#expect(amiiboSeries.count == 26) #expect(amiiboSeries.count == 28)
#expect(amiiboSeries.first?.key == "0x00") #expect(amiiboSeries.first?.key == "0x00")
#expect(amiiboSeries.last?.key == "0xff") #expect(amiiboSeries.last?.key == "0xff")
} }
@Test("Get Amiibo series by an existing key") @Test
func getAmiiboSeries_byExistingKey() async throws { func `get Amiibo series by an existing key`() async throws {
// GIVEN // GIVEN
let key = "0x01" let key = "0x01"
@@ -659,8 +661,8 @@ struct AmiiboServiceLiveTests {
#expect(amiiboSeries.first?.key == key) #expect(amiiboSeries.first?.key == key)
} }
@Test("Get Amiibo series by a non-existing key") @Test
func getAmiiboSeries_byNonExistingKey() async throws { func `get Amiibo series by a non-existing key`() async throws {
// GIVEN // GIVEN
let key = "0xf9" let key = "0xf9"
@@ -671,8 +673,8 @@ struct AmiiboServiceLiveTests {
} }
} }
@Test("Get Amiibo series by an incomplete key") @Test
func getAmiiboSeries_byIncompleteKey() async throws { func `get Amiibo series by an incomplete key`() async throws {
// GIVEN // GIVEN
let key = "0x" let key = "0x"
@@ -683,8 +685,8 @@ struct AmiiboServiceLiveTests {
} }
} }
@Test("Get Amiibo series by an empty key") @Test
func getAmiiboSeries_byEmptyKey() async throws { func `get Amiibo series by an empty key`() async throws {
// GIVEN // GIVEN
let key = "" let key = ""
@@ -695,8 +697,8 @@ struct AmiiboServiceLiveTests {
} }
} }
@Test("Get Amiibo series by an existing name") @Test
func getAmiiboSeries_byExistingName() async throws { func `get Amiibo series by an existing name`() async throws {
// GIVEN // GIVEN
let name = "Legend Of Zelda" let name = "Legend Of Zelda"
@@ -709,8 +711,8 @@ struct AmiiboServiceLiveTests {
#expect(amiiboSeries.first?.name == name) #expect(amiiboSeries.first?.name == name)
} }
@Test("Get Amiibo series by a non-existing name") @Test
func getAmiiboSeries_byNonExistingName() async throws { func `get Amiibo series by a non-existing name`() async throws {
// GIVEN // GIVEN
let name = "Something" let name = "Something"
@@ -721,8 +723,8 @@ struct AmiiboServiceLiveTests {
} }
} }
@Test("Get Amiibo series by an incomplete name") @Test
func getAmiiboSeries_byIncompleteName() async throws { func `get Amiibo series by an incomplete name`() async throws {
// GIVEN // GIVEN
let name = "Zelda" let name = "Zelda"
@@ -738,8 +740,8 @@ struct AmiiboServiceLiveTests {
#expect(amiiboSeriesName.name.contains(name)) #expect(amiiboSeriesName.name.contains(name))
} }
@Test("Get Amiibo series by an empty name") @Test
func getAmiiboSeries_byEmptyName() async throws { func `get Amiibo series by an empty name`() async throws {
// GIVEN // GIVEN
let name = "" let name = ""
@@ -748,13 +750,13 @@ struct AmiiboServiceLiveTests {
// THEN // THEN
#expect(!amiiboSeries.isEmpty) #expect(!amiiboSeries.isEmpty)
#expect(amiiboSeries.count == 26) #expect(amiiboSeries.count == 28)
#expect(amiiboSeries.first?.key == "0x00") #expect(amiiboSeries.first?.key == "0x00")
#expect(amiiboSeries.last?.key == "0xff") #expect(amiiboSeries.last?.key == "0xff")
} }
@Test("Get Amiibo types") @Test
func getAmiiboTypes() async throws { func `get Amiibo types`() async throws {
// GIVEN // GIVEN
// WHEN // WHEN
let amiiboTypes = try await service.getAmiiboTypes() let amiiboTypes = try await service.getAmiiboTypes()
@@ -766,8 +768,8 @@ struct AmiiboServiceLiveTests {
#expect(amiiboTypes.last?.key == "0x03") #expect(amiiboTypes.last?.key == "0x03")
} }
@Test("Get Amiibo types by an existing key") @Test
func getAmiiboTypes_byExistingKey() async throws { func `get Amiibo types by an existing key`() async throws {
// GIVEN // GIVEN
let key = "0x01" let key = "0x01"
@@ -780,8 +782,8 @@ struct AmiiboServiceLiveTests {
#expect(amiiboTypes.first?.key == key) #expect(amiiboTypes.first?.key == key)
} }
@Test("Get Amiibo types by a non-existing key") @Test
func getAmiiboTypes_byNonExistingKey() async throws { func `get Amiibo types by a non-existing key`() async throws {
// GIVEN // GIVEN
let key = "0x09" let key = "0x09"
@@ -792,8 +794,8 @@ struct AmiiboServiceLiveTests {
} }
} }
@Test("Get Amiibo types by an incomplete key") @Test
func getAmiiboTypes_byIncompleteKey() async throws { func `get Amiibo types by an incomplete key`() async throws {
// GIVEN // GIVEN
let key = "0x" let key = "0x"
@@ -804,8 +806,8 @@ struct AmiiboServiceLiveTests {
} }
} }
@Test("Get Amiibo types by an empty key") @Test
func getAmiiboTypes_byEmptyKey() async throws { func `get Amiibo types by an empty key`() async throws {
// GIVEN // GIVEN
let key = "" let key = ""
@@ -816,8 +818,8 @@ struct AmiiboServiceLiveTests {
} }
} }
@Test("Get Amiibo types by an existing name") @Test
func getAmiiboTypes_byExistingName() async throws { func `get Amiibo types by an existing name`() async throws {
// GIVEN // GIVEN
let name = "Card" let name = "Card"
@@ -830,8 +832,8 @@ struct AmiiboServiceLiveTests {
#expect(amiiboTypes.first?.name == name) #expect(amiiboTypes.first?.name == name)
} }
@Test("Get Amiibo types by a non-existing name") @Test
func getAmiiboTypes_byNonExistingName() async throws { func `get Amiibo types by a non-existing name`() async throws {
// GIVEN // GIVEN
let name = "Something" let name = "Something"
@@ -842,8 +844,8 @@ struct AmiiboServiceLiveTests {
} }
} }
@Test("Get Amiibo types by an incomplete name") @Test
func getAmiiboTypes_byIncompleteName() async throws { func `get Amiibo types by an incomplete name`() async throws {
// GIVEN // GIVEN
let name = "Ca" let name = "Ca"
@@ -859,8 +861,8 @@ struct AmiiboServiceLiveTests {
#expect(amiiboTypeName.name.contains(name)) #expect(amiiboTypeName.name.contains(name))
} }
@Test("Get Amiibo types by an empty name") @Test
func getAmiiboTypes_byEmptyName() async throws { func `get Amiibo types by an empty name`() async throws {
// GIVEN // GIVEN
let name = "" let name = ""
@@ -874,21 +876,21 @@ struct AmiiboServiceLiveTests {
#expect(amiiboTypes.last?.key == "0x03") #expect(amiiboTypes.last?.key == "0x03")
} }
@Test("Get game characters") @Test
func getGameCharacters() async throws { func `get Game characters`() async throws {
// GIVEN // GIVEN
// WHEN // WHEN
let gameCharacters = try await service.getGameCharacters() let gameCharacters = try await service.getGameCharacters()
// THEN // THEN
#expect(!gameCharacters.isEmpty) #expect(!gameCharacters.isEmpty)
#expect(gameCharacters.count == 644) #expect(gameCharacters.count == 668)
#expect(gameCharacters.first?.key == "0x0000") #expect(gameCharacters.first?.key == "0x0000")
#expect(gameCharacters.last?.key == "0x3f00") #expect(gameCharacters.last?.key == "0x3f00")
} }
@Test("Get game characters by an existing key") @Test
func getGameCharacters_byExistingKey() async throws { func `get Game characters by an existing key`() async throws {
// GIVEN // GIVEN
let key = "0x0001" let key = "0x0001"
@@ -901,8 +903,8 @@ struct AmiiboServiceLiveTests {
#expect(gameCharacters.first?.key == key) #expect(gameCharacters.first?.key == key)
} }
@Test("Get game characters by a non-existing key") @Test
func getGameCharacters_byNonExistingKey() async throws { func `get Game characters by a non-existing key`() async throws {
// GIVEN // GIVEN
let key = "0xffff" let key = "0xffff"
@@ -913,8 +915,8 @@ struct AmiiboServiceLiveTests {
} }
} }
@Test("Get game characters by an incomplete key") @Test
func getGameCharacters_byIncompleteKey() async throws { func `get Game characters by an incomplete key`() async throws {
// GIVEN // GIVEN
let key = "0x" let key = "0x"
@@ -925,8 +927,8 @@ struct AmiiboServiceLiveTests {
} }
} }
@Test("Get game characters by an empty key") @Test
func getGameCharacters_byEmptyKey() async throws { func `get Game characters by an empty key`() async throws {
// GIVEN // GIVEN
let key = "" let key = ""
@@ -937,8 +939,8 @@ struct AmiiboServiceLiveTests {
} }
} }
@Test("Get game characters by an existing name") @Test
func getGameCharacters_byExistingName() async throws { func `get Game characters by an existing name`() async throws {
// GIVEN // GIVEN
let name = "Zelda" let name = "Zelda"
@@ -951,8 +953,8 @@ struct AmiiboServiceLiveTests {
#expect(gameCharacters.first?.name == name) #expect(gameCharacters.first?.name == name)
} }
@Test("Get game characters by a non-existing name") @Test
func getGameCharacters_byNonExistingName() async throws { func `get Game characters by a non-existing name`() async throws {
// GIVEN // GIVEN
let name = "Something" let name = "Something"
@@ -963,8 +965,8 @@ struct AmiiboServiceLiveTests {
} }
} }
@Test("Get game characters by an incomplete name") @Test
func getGameCharacters_byIncompleteName() async throws { func `get Game characters by an incomplete name`() async throws {
// GIVEN // GIVEN
let name = "Zeld" let name = "Zeld"
@@ -980,8 +982,8 @@ struct AmiiboServiceLiveTests {
#expect(gameCharactersName.name.contains(name)) #expect(gameCharactersName.name.contains(name))
} }
@Test("Get game characters by an empty name") @Test
func getGameCharacters_byEmptyName() async throws { func `get Game characters by an empty name`() async throws {
// GIVEN // GIVEN
let name = "" let name = ""
@@ -990,26 +992,26 @@ struct AmiiboServiceLiveTests {
// THEN // THEN
#expect(!gameCharacters.isEmpty) #expect(!gameCharacters.isEmpty)
#expect(gameCharacters.count == 644) #expect(gameCharacters.count == 668)
#expect(gameCharacters.first?.key == "0x0000") #expect(gameCharacters.first?.key == "0x0000")
#expect(gameCharacters.last?.key == "0x3f00") #expect(gameCharacters.last?.key == "0x3f00")
} }
@Test("Get game series") @Test
func getGameSeries() async throws { func `get Game series`() async throws {
// GIVEN // GIVEN
// WHEN // WHEN
let gameSeries = try await service.getGameSeries() let gameSeries = try await service.getGameSeries()
// THEN // THEN
#expect(!gameSeries.isEmpty) #expect(!gameSeries.isEmpty)
#expect(gameSeries.count == 116) #expect(gameSeries.count == 117)
#expect(gameSeries.first?.key == "0x000") #expect(gameSeries.first?.key == "0x000")
#expect(gameSeries.last?.key == "0x3f0") #expect(gameSeries.last?.key == "0x3f0")
} }
@Test("Get game series by an existing key") @Test
func getGameSeries_byExistingKey() async throws { func `get Game series by an existing key`() async throws {
// GIVEN // GIVEN
let key = "0x001" let key = "0x001"
@@ -1022,8 +1024,8 @@ struct AmiiboServiceLiveTests {
#expect(gameSeries.first?.key == key) #expect(gameSeries.first?.key == key)
} }
@Test("Get game series by a non-existing key") @Test
func getGameSeries_byNonExistingKey() async throws { func `get Game Series by a non-existing key`() async throws {
// GIVEN // GIVEN
let key = "0xffff" let key = "0xffff"
@@ -1034,8 +1036,8 @@ struct AmiiboServiceLiveTests {
} }
} }
@Test("Get game series by an incomplete key") @Test
func getGameSeries_byIncompleteKey() async throws { func `get Game series by an incomplete key`() async throws {
// GIVEN // GIVEN
let key = "0x" let key = "0x"
@@ -1045,8 +1047,8 @@ struct AmiiboServiceLiveTests {
} }
} }
@Test("Get game series by an empty key") @Test
func getGameSeries_byEmptyKey() async throws { func `get Game series by an empty key`() async throws {
// GIVEN // GIVEN
let key = "" let key = ""
@@ -1057,8 +1059,8 @@ struct AmiiboServiceLiveTests {
} }
} }
@Test("Get game series by an existing name") @Test
func getGameSeries_byExistingName() async throws { func `get Game series by an existing name`() async throws {
// GIVEN // GIVEN
let name = "Pikmin" let name = "Pikmin"
@@ -1071,8 +1073,8 @@ struct AmiiboServiceLiveTests {
#expect(gameSeries.first?.name == name) #expect(gameSeries.first?.name == name)
} }
@Test("Get game series by a non-existing name") @Test
func getGameSeries_byNonExistingName() async throws { func `get Game series by a non-existing name`() async throws {
// GIVEN // GIVEN
let name = "Something" let name = "Something"
@@ -1083,8 +1085,8 @@ struct AmiiboServiceLiveTests {
} }
} }
@Test("Get game series by an incomplete name") @Test
func getGameSeries_byIncompleteName() async throws { func `get Game series by an incomplete name`() async throws {
// GIVEN // GIVEN
let name = "Pik" let name = "Pik"
@@ -1100,8 +1102,8 @@ struct AmiiboServiceLiveTests {
#expect(gameSeriesName.name.contains(name)) #expect(gameSeriesName.name.contains(name))
} }
@Test("Get game series by an empty name") @Test
func getGameSeries_byEmptyName() async throws { func `get Game series by an empty name`() async throws {
// GIVEN // GIVEN
let name = "" let name = ""
@@ -1110,13 +1112,13 @@ struct AmiiboServiceLiveTests {
// THEN // THEN
#expect(!gameSeries.isEmpty) #expect(!gameSeries.isEmpty)
#expect(gameSeries.count == 116) #expect(gameSeries.count == 117)
#expect(gameSeries.first?.key == "0x000") #expect(gameSeries.first?.key == "0x000")
#expect(gameSeries.last?.key == "0x3f0") #expect(gameSeries.last?.key == "0x3f0")
} }
@Test("Get the last updated timestamp") @Test
func getLastUpdated() async throws { func `get the Last Updated timestamp`() async throws {
// GIVEN // GIVEN
// WHEN // WHEN
let dateLastUpdated = try await service.getLastUpdated() let dateLastUpdated = try await service.getLastUpdated()
@@ -1127,9 +1129,9 @@ struct AmiiboServiceLiveTests {
from: dateLastUpdated from: dateLastUpdated
) )
#expect(dateComponents.year == 2024) #expect(dateComponents.year == 2025)
#expect(dateComponents.month == 9) #expect(dateComponents.month == 7)
#expect(dateComponents.day == 6) #expect(dateComponents.day == 18)
} }
} }