예제 #1
0
 public void ChocolateBar_BreakChocolate_MoreSimpleTests()
 {
     Assert.AreEqual(24, ChocolateBar.BreakChocolate(5, 5));
     Assert.AreEqual(27, ChocolateBar.BreakChocolate(7, 4));
     Assert.AreEqual(0, ChocolateBar.BreakChocolate(1, 1));
     Assert.AreEqual(0, ChocolateBar.BreakChocolate(0, 0), "What If I Told You There is No Chocolate?");
     Assert.AreEqual(5, ChocolateBar.BreakChocolate(6, 1));
 }
예제 #2
0
        public void ChocolateBar_BreakChocolate_RandomTests()
        {
            for (int i = 0; i < 100; ++i)
            {
                int n = rnd.Next(0, 20);
                int m = rnd.Next(0, 20);

                int expected = solution(n, m);
                int actual   = ChocolateBar.BreakChocolate(n, m);
                Assert.AreEqual(expected, actual);
            }
        }
예제 #3
0
 public void ChocolateBar_BreakChocolate_SimpleTests()
 {
     Assert.AreEqual(24, ChocolateBar.BreakChocolate(5, 5));
     Assert.AreEqual(0, ChocolateBar.BreakChocolate(1, 1));
 }