Skip to content

Commit

Permalink
PersonCombinedCreditsTests
Browse files Browse the repository at this point in the history
  • Loading branch information
adamayoung committed Nov 19, 2024
1 parent 773b909 commit 809024b
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions Tests/TMDbTests/Domain/Models/PersonCombinedCreditsTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand Down

0 comments on commit 809024b

Please sign in to comment.