public void GetSchedule_TournamentWithoutGames_EmptyScheduleReturned() { // Arrange const byte TEST_ROUND_COUNT = 5; var tournament = CreateTournamentData(TEST_ROUND_COUNT); SetupGetTournamentResults(TOURNAMENT_ID, new List <GameResultDto>()); MockGetScheduleInfo(TOURNAMENT_ID, tournament); var expected = new ScheduleViewModelTestFixture().WithEmptyResult().Build(); var sut = BuildSUT(); // Act var actual = sut.GetSchedule(TOURNAMENT_ID); // Assert _gameServiceMock.Verify(ts => ts.GetTournamentGames(TOURNAMENT_ID), Times.Once()); ScheduleViewModelComparer.AssertAreEqual(expected, actual); }
public void GetSchedule_PlayoffScheme_NotScheduledGamesAreRemoved() { // Arrange const byte TEST_ROUND_COUNT = 3; var tournament = CreateTournamentData(TEST_ROUND_COUNT); tournament.Scheme = TournamentSchemeEnum.PlayOff; MockGetScheduleInfo(TOURNAMENT_ID, tournament); SetupGetTournamentResults(TOURNAMENT_ID, new GameServiceTestFixture().TestPlayoffWithFirstRoundScheduledOnly().Build()); var expected = new ScheduleViewModelTestFixture().WithPlayoffWithFirstRoundScheduledOnly().Build(); var sut = BuildSUT(); // Act var actual = sut.GetSchedule(TOURNAMENT_ID); // Assert ScheduleViewModelComparer.AssertAreEqual(expected, actual); }
public void GetSchedule_TournamentHasFreeDayGame_FreeDayGameIsLast() { // Arrange const byte TEST_ROUND_COUNT = 5; var tournament = CreateTournamentData(TEST_ROUND_COUNT); var testGames = new GameServiceTestFixture() .TestGamesForSeveralDivisionsAndFreeDayGameInOneDay() .Build(); MockGetScheduleInfo(TOURNAMENT_ID, tournament); SetupGetTournamentResults(TOURNAMENT_ID, testGames); var expected = new ScheduleViewModelTestFixture().WithGamesInSeveralDivisionsAndFreeDayGameInOneDay().Build(); var sut = BuildSUT(); // Act var actual = sut.GetSchedule(TOURNAMENT_ID); // Assert ScheduleViewModelComparer.AssertAreEqual(expected, actual); }
public void GetSchedule_TournamentPlayedOverSeveralYears_ScheduleIsOrderedByYearThenByWeek() { // Arrange const byte TEST_ROUND_COUNT = 5; var tournament = CreateTournamentData(TEST_ROUND_COUNT); var testGames = new GameServiceTestFixture() .TestGamesInSeveralYearsAndWeeks() .Build(); MockGetScheduleInfo(TOURNAMENT_ID, tournament); SetupGetTournamentResults(TOURNAMENT_ID, testGames); var expected = new ScheduleViewModelTestFixture().WithGamesInSeveralYearsAndWeeks().Build(); var sut = BuildSUT(); // Act var actual = sut.GetSchedule(TOURNAMENT_ID); // Assert ScheduleViewModelComparer.AssertAreEqual(expected, actual); }
public void GetSchedule_TournamentWithTwoWeeksTwoDivisionsTwoGames_ScheduleReturned() { // Arrange const byte TEST_ROUND_COUNT = 5; var tournament = CreateTournamentData(TEST_ROUND_COUNT); var testGames = new GameServiceTestFixture(). TestGamesWithResultInTwoWeeksTwoDivisionsTwoGames(). Build(); MockGetScheduleInfo(TOURNAMENT_ID, tournament); SetupGetTournamentResults(TOURNAMENT_ID, testGames); var expected = new ScheduleViewModelTestFixture().WithTwoWeeksTwoDivisionsTwoGames().Build(); var sut = BuildSUT(); // Act var actual = sut.GetSchedule(TOURNAMENT_ID); // Assert _gameServiceMock.Verify(ts => ts.GetTournamentGames(TOURNAMENT_ID), Times.Once()); ScheduleViewModelComparer.AssertAreEqual(expected, actual); }