Example #1
0
        public void OverallEaten_Sample_5()
        {
            var solver = new ChocolatesByNumbers();
            var amount = solver.OverallEaten(10, 4);

            amount.Should().Be(5);
        }
Example #2
0
        public void ShoulCountChocolatesEaten(int n, int m, int expected)
        {
            var counter = new ChocolatesByNumbers();
            int actual  = counter.Count(n, m);

            Assert.AreEqual(expected, actual);
        }
Example #3
0
        public void OverallEaten_AllSemiprimeStep_UntilValueRepeats()
        {
            var solver = new ChocolatesByNumbers();
            var amount = solver.OverallEaten(947853, 4453);

            amount.Should().Be(947853);
        }
Example #4
0
        public void OverallEaten_AllSmallerThanStep_UntilValueRepeats()
        {
            var solver = new ChocolatesByNumbers();
            var amount = solver.OverallEaten(4, 10);

            amount.Should().Be(2);
        }
Example #5
0
        public void OverallEaten_AllSemiprimeToStep_All()
        {
            var solver = new ChocolatesByNumbers();
            var amount = solver.OverallEaten(10, 3);

            amount.Should().Be(10);
        }
Example #6
0
        public void OverallEaten_AllEqualToStep_1()
        {
            var solver = new ChocolatesByNumbers();
            var amount = solver.OverallEaten(10, 10);

            amount.Should().Be(1);
        }
Example #7
0
        public void OverallEaten_AllDividableByStep_DivisionTime()
        {
            var solver = new ChocolatesByNumbers();
            var amount = solver.OverallEaten(10, 5);

            amount.Should().Be(2);
        }