Пример #1
0
        public void ShouldCalculateEstimation_WhenGoodValuesAreProvided()
        {
            IRankingService rankingService = CreateService;

            float estimation = rankingService.GetEstimation(RankingValues.LeftValidValue, RankingValues.RightValidValue);

            Assert.Equal(RankingValues.PreCalculatedLeftEstimation, estimation);
        }
Пример #2
0
        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);
        }
Пример #3
0
        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);
        }
Пример #4
0
        public void ShouldThrow_WhenInvalidElosAreProvided()
        {
            IRankingService rankingService = CreateService;

            Assert.Throws <Exception>(() =>
            {
                float estimation = rankingService.GetEstimation(-12, 0);
            });
        }