public void TournamentAggregate_CalculateCSS_CSSAlreadyCalculated_ErrorThrown() { TournamentAggregate aggregate = TournamentTestData.GetCompletedTournamentAggregate(1, 2, 7, 20, 5, 5); aggregate.CalculateCSS(); Should.Throw <InvalidOperationException>(() => { aggregate.CalculateCSS(); }); }
public void TournamentAggregate_CalculateCSS_CSSCalculated(Int32 category1Scores, Int32 category2Scores, Int32 category3Scores, Int32 category4Scores, Int32 category5Scores, Int32 bufferorbetter, Int32 expectedAdjustment, Int32 expectedCSS) { TournamentAggregate aggregate = TournamentTestData.GetCompletedTournamentAggregate(category1Scores, category2Scores, category3Scores, category4Scores, category5Scores, bufferorbetter); aggregate.CalculateCSS(); aggregate.Adjustment.ShouldBe(expectedAdjustment); aggregate.CSS.ShouldBe(expectedCSS); aggregate.GetScores().All(s => s.IsPublished).ShouldBeTrue(); }
public void TournamentAggregate_ProduceResult_CSSNotCalculated_ErrorThrown() { TournamentAggregate tournamentAggregate = TournamentTestData.GetCompletedTournamentAggregate(20, 15, 23, 16, 0, 5); Should.Throw <InvalidOperationException>(() => tournamentAggregate.ProduceResult()); }
public void TournamentAggregate_SignUpForTournament_TournamentCompleted_ErrorThrown() { TournamentAggregate tournament = TournamentTestData.GetCompletedTournamentAggregate(); Should.Throw <InvalidOperationException>(() => { tournament.SignUpForTournament(TournamentTestData.PlayerId); }); }
public void TournamentAggregate_CompleteTournament_TournamentAlreadyCompleted_ErrorThrown() { TournamentAggregate aggregate = TournamentTestData.GetCompletedTournamentAggregate(1, 2, 7, 20, 5, 5); Should.Throw <InvalidOperationException>(() => { aggregate.CompleteTournament(TournamentTestData.CompletedDateTime); }); }