예제 #1
0
        public void test_solution_withGivenArray_returnsTheEarliestTimeWhenTheFrogCanJump(int[] given, int expected,
                                                                                          int distance)
        {
            var target = new FrogRiverOne();
            var actual = target.solution(distance, given);

            Assert.AreEqual(expected, actual);
        }
예제 #2
0
        public void FrogRiverOne_Should_Validate_Complex_Array()
        {
            FrogRiverOne subject = new FrogRiverOne();

            int[] array = { 4, 1, 2, 8, 7, 3, 2, 6, 1, 2, 9, 11, 13, 14, 16, 17, 12, 13, 14, 15, 18, 5, 10 };

            int result = subject.solution(10, array);

            Assert.Equal(22, result);
        }
예제 #3
0
        public void FrogRiverOne_Should_Invalidate_Incomplete_Array()
        {
            FrogRiverOne subject = new FrogRiverOne();

            int[] array = { 4, 1, 2 };

            int result = subject.solution(5, array);

            Assert.Equal(-1, result);
        }
예제 #4
0
        public void FrogRiverOne_Should_Validate_Complete_Array()
        {
            FrogRiverOne subject = new FrogRiverOne();

            int[] array = { 1, 3, 1, 4, 2, 3, 5, 4 };

            int result = subject.solution(5, array);

            Assert.Equal(6, result);
        }
예제 #5
0
        public void FrogRiverOne_Should_Handle_Empty_Array()
        {
            FrogRiverOne subject = new FrogRiverOne();

            int[] array = { };

            int result = subject.solution(1, array);

            Assert.Equal(-1, result);
        }
예제 #6
0
        public void Case1()
        {
            // Arrange
            var algorithm = new FrogRiverOne();
            int X         = 5;
            var A         = new int[] { 1, 3, 1, 4, 2, 3, 5, 4 };

            // Act
            var result = algorithm.solution(X, A);

            // Assert
            var expected = 6;

            Assert.Equal(expected, result);
        }
예제 #7
0
        public void FrogRiverOneTest_01()
        {
            var result = fg.solution(5, new int[] { 1, 3, 1, 4, 2, 3, 5 });

            Assert.AreEqual(6, result);
        }
예제 #8
0
        private void Test(int x, int[] a, int expectedResult)
        {
            var result = _frogRiverOne.solution(x, a);

            Assert.AreEqual(expectedResult, result);
        }