Example #1
0
        public void ArrayIsOutOfRangeTest()
        {
            bool catchException = false;

            try
            {
                FrogRiverOne.Solution(5, new int[100001]);
            }
            catch (ArgumentOutOfRangeException)
            {
                catchException = true;
            }

            if (catchException)
            {
                Assert.Pass();
            }
            else
            {
                Assert.Fail();
            }
        }
Example #2
0
        public void EmptyArrayTest()
        {
            bool catchException = false;

            try
            {
                FrogRiverOne.Solution(5, null);
            }
            catch (ArgumentNullException)
            {
                catchException = true;
            }

            if (catchException)
            {
                Assert.Pass();
            }
            else
            {
                Assert.Fail();
            }
        }
Example #3
0
 public void StraightTest()
 {
     Assert.AreEqual(2, FrogRiverOne.Solution(3, new[] { 1, 2, 3, 1, 1, 3, 2 }));
 }
Example #4
0
 public void ExampleTest()
 {
     Assert.AreEqual(6, FrogRiverOne.Solution(5, new [] { 1, 3, 1, 4, 2, 3, 5, 4 }));
 }
Example #5
0
 public void NotEnoughElementsTest()
 {
     Assert.AreEqual(-1, FrogRiverOne.Solution(6, new [] { 1, 3, 5 }));
 }
Example #6
0
 public void OneElementTest()
 {
     Assert.AreEqual(0, FrogRiverOne.Solution(1, new[] { 1 }));
 }
Example #7
0
 public void OpositeTest()
 {
     Assert.AreEqual(2, FrogRiverOne.Solution(3, new[] { 3, 2, 1, 1, 1, 3, 2 }));
 }
Example #8
0
 public void NegativeTest()
 {
     Assert.AreEqual(-1, FrogRiverOne.Solution(3, new [] { 1, 1, 3, 1, 3 }));
 }