public void TestGetWinnerMatchWhitNotaDifferent() { // Arrange var expected = new MovieBuilder() .WithNota(9M) .Build(); var secondMovie = new MovieBuilder() .Build(); var tournament = new TournamentBuilder().Build(); var standing = new Standing(tournament); // Act var result = standing.GetWinnerMatch(expected, secondMovie); // Assert result.Should().BeEquivalentTo(expected); }
public void TestGenerateMatchWhitValidTournament() { // Arrange var tournament = new TournamentBuilder().Build(); var standing = new Standing(tournament); var firstMovie = tournament.Movies.First(); var lastMovie = tournament.Movies.First(); var expected = standing.GetWinnerMatch(firstMovie, lastMovie); // Act var result = standing.GenerateMatch(firstMovie, lastMovie); // Assert standing.Rankings.Count() .Should().Be(tournament.Movies.Count()); standing.Rankings .FirstOrDefault(r => r.Movie.Id == expected.Id) .Score.Should().Be(1); result.Should().BeEquivalentTo(expected); }