コード例 #1
0
        public void TestCase_FromTestData_Success()
        {
            JesseAndCookiesSolution solution = new JesseAndCookiesSolution(new[] { 12, 10, 9, 3, 2, 1L }, 7L);

            Assert.That(solution.CalculateOperations(), Is.EqualTo(2));
        }
コード例 #2
0
        public void TestCase_SevenZeroCookies_ReturnsMinus1Operations()
        {
            JesseAndCookiesSolution solution = new JesseAndCookiesSolution(new[] { 0L, 0L, 0L, 0L, 0L, 0L, 0L }, 7L);

            Assert.That(solution.CalculateOperations(), Is.EqualTo(-1));
        }
コード例 #3
0
        public void TestCase_TwoSmallCookiesThatSmalles_Returns1Operations()
        {
            JesseAndCookiesSolution solution = new JesseAndCookiesSolution(new[] { 3L, 4 }, 7L);

            Assert.That(solution.CalculateOperations(), Is.EqualTo(1));
        }
コード例 #4
0
        public void TestCase_SevenSmallCookies_Returns5Operations()
        {
            JesseAndCookiesSolution solution = new JesseAndCookiesSolution(new[] { 1L, 1L, 1L, 1L, 1L, 1L, 1L }, 7L);

            Assert.That(solution.CalculateOperations(), Is.EqualTo(5));
        }
コード例 #5
0
        public void TestCase_TwoBigCookies_Returns0Operations()
        {
            JesseAndCookiesSolution solution = new JesseAndCookiesSolution(new[] { 8L, 9 }, 7L);

            Assert.That(solution.CalculateOperations(), Is.EqualTo(0));
        }