public void ArrayIsOutOfRangeTest() { bool catchException = false; try { FrogRiverOne.Solution(5, new int[100001]); } catch (ArgumentOutOfRangeException) { catchException = true; } if (catchException) { Assert.Pass(); } else { Assert.Fail(); } }
public void EmptyArrayTest() { bool catchException = false; try { FrogRiverOne.Solution(5, null); } catch (ArgumentNullException) { catchException = true; } if (catchException) { Assert.Pass(); } else { Assert.Fail(); } }
public void StraightTest() { Assert.AreEqual(2, FrogRiverOne.Solution(3, new[] { 1, 2, 3, 1, 1, 3, 2 })); }
public void ExampleTest() { Assert.AreEqual(6, FrogRiverOne.Solution(5, new [] { 1, 3, 1, 4, 2, 3, 5, 4 })); }
public void NotEnoughElementsTest() { Assert.AreEqual(-1, FrogRiverOne.Solution(6, new [] { 1, 3, 5 })); }
public void OneElementTest() { Assert.AreEqual(0, FrogRiverOne.Solution(1, new[] { 1 })); }
public void OpositeTest() { Assert.AreEqual(2, FrogRiverOne.Solution(3, new[] { 3, 2, 1, 1, 1, 3, 2 })); }
public void NegativeTest() { Assert.AreEqual(-1, FrogRiverOne.Solution(3, new [] { 1, 1, 3, 1, 3 })); }