Esempio n. 1
0
        public void Rules_HcpAvgThirdCeiled_Should_CalculateAvgScore_NotAll_Scenario_1_0()
        {
            var rounds = RoundObjectMother.GetRounds(new List <Tuple <DateTime, int> >
            {
                new Tuple <DateTime, int>(DateTime.Parse("2020-01-01"), 59)
            });

            var rule = new RuleAvgThirdCeiled(new HcpConfiguration {
                TotalRounds = 18
            });

            var value = rule.CalculateAvgScore(rounds);

            Assert.IsTrue(value == 59.0);

            Assert.Pass();
        }
        public void Rules_HcpAvgThirdFloored_Should_CalculateAvgScore_All_Scenario_1_1()
        {
            var rounds = RoundObjectMother.GetRounds(new List <Tuple <DateTime, int> >
            {
                new Tuple <DateTime, int>(DateTime.Parse("2020-01-01"), 59),
                new Tuple <DateTime, int>(DateTime.Parse("2020-01-02"), 60),
                new Tuple <DateTime, int>(DateTime.Parse("2020-01-03"), 61),
                new Tuple <DateTime, int>(DateTime.Parse("2020-01-04"), 62)
            });

            var rule = new RuleAvgThirdFloored(new HcpConfiguration {
                TotalRounds = 3
            });

            var value = rule.CalculateAvgScore(rounds);

            Assert.IsTrue(value == 60.0);

            Assert.Pass();
        }