public void TestGetFirstLocalMax1() { int firstLocalMaxIndex = GetFirstLocalMaxInArray.GetIndexOfFirstLocalMax(new int[] { 6, 6, 6, 6, 6 }); int expectedIndex = -1; Assert.AreEqual(expectedIndex, firstLocalMaxIndex); }
public void TestGetFirstLocalMax6() { int firstLocalMaxIndex = GetFirstLocalMaxInArray.GetIndexOfFirstLocalMax(new decimal[] { -245.98M, 6.79M, 5.234M, 9.0M, 0, -1 }); int expectedIndex = 1; Assert.AreEqual(expectedIndex, firstLocalMaxIndex); }
public void TestGetFirstLocalMax3() { int firstLocalMaxIndex = GetFirstLocalMaxInArray.GetIndexOfFirstLocalMax(new int[] { 6, 7, 9, 0, -1 }); int expectedIndex = 2; Assert.AreEqual(expectedIndex, firstLocalMaxIndex); }
public void TestGetFirstLocalMax5_ThrowsException() { int firstLocalMaxIndex = GetFirstLocalMaxInArray.GetIndexOfFirstLocalMax(new int[0]); Assert.Fail(); }
public void TestGetFirstLocalMax4_ThrowsException() { int firstLocalMaxIndex = GetFirstLocalMaxInArray.GetIndexOfFirstLocalMax((int[])null); Assert.Fail(); }