Example #1
0
 public void NonDecreasingTest()
 {
     Assert.AreEqual(true, MonotoneTravel.IsMonotone(new int[] { 1, 2, 3, 3, 4, 5 }));
 }
Example #2
0
 public void DecreasingTest()
 {
     Assert.AreEqual(false, MonotoneTravel.IsMonotone(Enumerable.Range(1, 5).Reverse().ToArray()));
 }
Example #3
0
 public void ConstantTest()
 {
     Assert.AreEqual(true, MonotoneTravel.IsMonotone(new int[] { 5, 5, 5, 5, 5 }));
 }
Example #4
0
 public void EmptyTest()
 {
     Assert.AreEqual(true, MonotoneTravel.IsMonotone(new int[] { }));
 }
Example #5
0
 public void IncreasingTest()
 {
     Assert.AreEqual(true, MonotoneTravel.IsMonotone(Enumerable.Range(1, 10).ToArray()));
     Assert.AreEqual(true, MonotoneTravel.IsMonotone(Enumerable.Range(4, 9).ToArray()));
 }