Esempio n. 1
0
        public void TestJump()
        {
            int[] clouds = new int[] { 0, 1, 0, 0, 0, 1, 0 };
            int   jumps  = JumpingOnTheClouds.GetMinimumJumps(clouds);

            clouds = new int[] { 0, 0, 1, 0, 0, 1, 0 };
            jumps  = JumpingOnTheClouds.GetMinimumJumps(clouds);
            Assert.IsTrue(jumps == 4);
        }
Esempio n. 2
0
        public void JumpingOnTheCloudsTestCase3()
        {
            var clouds        = new int[] { 0, 0, 0, 1, 0, 0 };
            var expectedJumps = 3;

            var actualJumps = JumpingOnTheClouds.Solve(clouds);

            Assert.AreEqual(expectedJumps, actualJumps);
        }
Esempio n. 3
0
        public void JumpingOnCloudsTest(int [] clouds, int expectedResult)
        {
            //Arrange

            //Act
            int actual = JumpingOnTheClouds.JumpingOnClouds(clouds);

            //Assert
            Assert.AreEqual(expectedResult, actual);
        }
        public void TestCase1()
        {
            //Arrange
            string path    = "0 0 0 1 0 0";
            var    pathArr = path.Split(' ').Select(n => Convert.ToInt32(n)).ToArray();
            //Act
            var result = JumpingOnTheClouds.JumpingOnClouds(pathArr);

            //Assert
            Assert.AreEqual(3, result);
        }
Esempio n. 5
0
        public void Run()
        {
            PrintProblem();

            Console.WriteLine("c:");
            c = System.Array.ConvertAll(Console.ReadLine().Split(' '), cTemp => Convert.ToInt32(cTemp));

            int result = JumpingOnTheClouds.jumpingOnClouds(c);

            Console.WriteLine();
            Console.WriteLine("Result:");
            Console.WriteLine(result);
            Console.ReadKey();
        }
Esempio n. 6
0
 public void JumpingOnTheCloudsTest(int[] c, int expected)
 {
     Assert.Equal(expected, JumpingOnTheClouds.Execute(c));
 }
 public void GivenNoClouds_WhenJumpingOnTheClouds_ThenExpectedMinimumJumpsIsReturned()
 {
     Assert.Equal(0, JumpingOnTheClouds.Go(new int[] { }));
 }
 public void GivenTestCase1_WhenJumpingOnTheClouds_ThenExpectedMinimumJumpsIsReturned()
 {
     //Assert.Equal("1346", JumpingOnTheClouds.GetPath(new int[] { 0, 0, 1, 0, 0, 1, 0 }));
     Assert.Equal(3, JumpingOnTheClouds.Go(new int[] { 0, 0, 0, 1, 0, 0 }));
 }