Tests updates and other fixes (#27)

This PR contains the work done to update the live test data to its latest version. Plus other improvements have been made:

* conformed the `AmiiboServiceError` error to the `LocalizableError` protocol,
* improved the `ISODateTimeTranscoder` transcoder to handle the decoding of both ISO dates and timestamps,
* removed a force-unwrapped from the `AmiiboLiveClient` type.

Reviewed-on: #27
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 #27.
This commit is contained in:
2026-03-27 17:14:26 +00:00
committed by Javier Cicchelli
parent 2442ada4b6
commit 1488aa151e
151 changed files with 259 additions and 197 deletions
@@ -175,7 +175,7 @@ struct AmiiboServiceLiveTests {
@Test
func `get the last updated timestamp`() async throws {
try await assertLastUpdated(
day: 14,
day: 26,
month: 3,
year: 2026
)
@@ -324,7 +324,7 @@ struct AmiiboServiceLiveTests {
@Test("get last updated timestamp")
func getLastUpdated() async throws {
try await assertLastUpdated(
day: 14,
day: 26,
month: 3,
year: 2026
)
@@ -661,7 +661,7 @@ enum Input {
enum Output {
/// A list of number of items that are expected from the `assertAmiibos` assertion.
static let amiibos: [Int] = [.totalAmiibos, 7, 7, 1, 1, 1, .zero, .zero, 5, .zero, 7, .totalAmiibos, 244, 244, .zero, .zero, .zero, .zero, 96, 26, .zero, .zero, 63, .totalAmiibos, 12, 6, .zero, .zero, .zero, .totalAmiibos, 49, 32, .zero, .zero, 147, .totalAmiibos, .totalAmiibos, .totalAmiibos]
static let amiibos: [Int] = [.totalAmiibos, 7, 7, 1, 1, 1, .zero, .zero, 5, .zero, 7, .totalAmiibos, 247, 247, .zero, .zero, .zero, .zero, 96, 26, .zero, .zero, 63, .totalAmiibos, 13, 6, .zero, .zero, .zero, .totalAmiibos, 51, 32, .zero, .zero, 150, .totalAmiibos, .totalAmiibos, .totalAmiibos]
/// A list of errors are expected to be thrown from the `assertAmiibosThrows` assertion.
static let amiibosThrows: [AmiiboServiceError] = [.badRequest, .badRequest, .badRequest, .badRequest, .badRequest, .badRequest, .badRequest]
/// A list of number of items that are expected from the `assertAmiiboSeries` assertion.
@@ -686,13 +686,13 @@ enum Output {
private extension Int {
/// A number that represents the total number of amiibo items currently available at the live service.
static let totalAmiibos = 936
static let totalAmiibos = 939
/// A number that represents the total number of amiibo series currently available at the live service.
static let totalAmiiboSeries = 30
/// A number that represents the total number of amiibo types currently available at the live service.
static let totalAmiiboTypes = 5
/// A number that represents the total number of game characters currently available at the live service.
static let totalGameCharacters = 679
static let totalGameCharacters = 680
/// A number that represents the total number of game series currently available at the live service.
static let totalGameSeries = 117
}