public void ShouldCalculateEstimation_WhenGoodValuesAreProvided() { IRankingService rankingService = CreateService; float estimation = rankingService.GetEstimation(RankingValues.LeftValidValue, RankingValues.RightValidValue); Assert.Equal(RankingValues.PreCalculatedLeftEstimation, estimation); }
public void ShouldLimitElo_WhenToMuchPointsAreLost() { IRankingService rankingService = CreateService; float estimation = rankingService.GetEstimation(RankingValues.Limit, RankingValues.Limit); int newElo = rankingService.GetNewElo(RankingValues.Limit, estimation, false); Assert.Equal(RankingValues.Limit, newElo); }
public void ShouldComputeNewElo_WhenLost() { IRankingService rankingService = CreateService; float estimation = rankingService.GetEstimation(RankingValues.LeftValidValue, RankingValues.RightValidValue); int newElo = rankingService.GetNewElo(RankingValues.LeftValidValue, estimation, false); Assert.Equal(RankingValues.LeftLostExpectedNewElo, newElo); }
public void ShouldThrow_WhenInvalidElosAreProvided() { IRankingService rankingService = CreateService; Assert.Throws <Exception>(() => { float estimation = rankingService.GetEstimation(-12, 0); }); }