From 809024b2970f8c6695519d0733ba415769bf8db0 Mon Sep 17 00:00:00 2001 From: Adam Young Date: Tue, 19 Nov 2024 15:35:39 +0000 Subject: [PATCH] PersonCombinedCreditsTests --- .../Models/PersonCombinedCreditsTests.swift | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/Tests/TMDbTests/Domain/Models/PersonCombinedCreditsTests.swift b/Tests/TMDbTests/Domain/Models/PersonCombinedCreditsTests.swift index 901e3a74..6c110f9f 100644 --- a/Tests/TMDbTests/Domain/Models/PersonCombinedCreditsTests.swift +++ b/Tests/TMDbTests/Domain/Models/PersonCombinedCreditsTests.swift @@ -35,6 +35,40 @@ struct PersonCombinedCreditsTests { #expect(result.crew == personCombinedCredits.crew) } + @Test("allShows contains a unique list of cast and crew TV series") + func allShowsContainsUniqueListOfCastAndCrewTVSeries() throws { + let credits = PersonCombinedCredits( + id: 1, + cast: [ + .movie(.mock(id: 10)), + .movie(.mock(id: 11)), + .tvSeries(.mock(id: 20)), + .tvSeries(.mock(id: 21)) + ], + crew: [ + .movie(.mock(id: 10)), + .movie(.mock(id: 12)), + .movie(.mock(id: 13)), + .tvSeries(.mock(id: 20)), + .tvSeries(.mock(id: 22)), + .tvSeries(.mock(id: 23)) + ] + ) + + let expectedAllShows: [Show] = [ + .movie(.mock(id: 10)), + .movie(.mock(id: 11)), + .tvSeries(.mock(id: 20)), + .tvSeries(.mock(id: 21)), + .movie(.mock(id: 12)), + .movie(.mock(id: 13)), + .tvSeries(.mock(id: 22)), + .tvSeries(.mock(id: 23)) + ] + + #expect(credits.allShows == expectedAllShows) + } + private let personCombinedCredits = PersonCombinedCredits( id: 287, cast: [