示例#1
0
 public void MagicIndex2BinarySearchCompleteTests4NonDistinct()
 {
     try
     {
         MagicIndex2BinarySearchComplete.FindMagicIndex(new[] { -10, -5, 2, 2, 2, 3, 4, 8, 9, 12, 13 });
     }
     catch (ArgumentException)
     {
         Assert.IsTrue(true);
         return;
     }
     Assert.Fail();
 }
示例#2
0
 public void MagicIndex2BinarySearchCompleteTests2NoMatch()
 {
     Assert.AreEqual(-1, MagicIndex2BinarySearchComplete.FindMagicIndex(new[] { -40, -20, -1, 1, 2, 3, 5, 8, 9, 12, 13 }));
 }
示例#3
0
 public void MagicIndex2BinarySearchCompleteTests3EmptyArray()
 {
     Assert.AreEqual(-1, MagicIndex2BinarySearchComplete.FindMagicIndex(new int[0]));
 }
示例#4
0
 public void MagicIndex2BinarySearchCompleteTests1General()
 {
     Assert.AreEqual(7, MagicIndex2BinarySearchComplete.FindMagicIndex(new[] { -40, -20, -1, 1, 2, 3, 5, 7, 9, 12, 13 }));
 }