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

            amount.Should().Be(5);
        }
예제 #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);
        }
예제 #3
0
        public void OverallEaten_AllSemiprimeStep_UntilValueRepeats()
        {
            var solver = new ChocolatesByNumbers();
            var amount = solver.OverallEaten(947853, 4453);

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

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

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

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

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