예제 #1
0
 public void TestTripleNotFound()
 {
     Assert.AreEqual(-1, BinarySearch.Chop(0, _arrayOfThree));
     Assert.AreEqual(-1, BinarySearch.Chop(2, _arrayOfThree));
     Assert.AreEqual(-1, BinarySearch.Chop(4, _arrayOfThree));
     Assert.AreEqual(-1, BinarySearch.Chop(6, _arrayOfThree));
 }
예제 #2
0
 public void TestQuadripleNotFound()
 {
     Assert.AreEqual(-1, BinarySearch.Chop(0, _arrayOfFour));
     Assert.AreEqual(-1, BinarySearch.Chop(2, _arrayOfFour));
     Assert.AreEqual(-1, BinarySearch.Chop(4, _arrayOfFour));
     Assert.AreEqual(-1, BinarySearch.Chop(6, _arrayOfFour));
     Assert.AreEqual(-1, BinarySearch.Chop(8, _arrayOfFour));
 }
예제 #3
0
 public void TestQuadripleFindFourth()
 {
     Assert.AreEqual(3, BinarySearch.Chop(7, _arrayOfFour));
 }
예제 #4
0
 public void TestQuadripleFindThird()
 {
     Assert.AreEqual(2, BinarySearch.Chop(5, _arrayOfFour));
 }
예제 #5
0
 public void TestQuadripleFindSecond()
 {
     Assert.AreEqual(1, BinarySearch.Chop(3, _arrayOfFour));
 }
예제 #6
0
 public void TestQuadripleFindFirst()
 {
     Assert.AreEqual(0, BinarySearch.Chop(1, _arrayOfFour));
 }
예제 #7
0
 public void TestTripleThird()
 {
     Assert.AreEqual(2, BinarySearch.Chop(5, _arrayOfThree));
 }
예제 #8
0
 public void TestTripleSecond()
 {
     Assert.AreEqual(1, BinarySearch.Chop(3, _arrayOfThree));
 }
예제 #9
0
 public void TestTripleFirst()
 {
     Assert.AreEqual(0, BinarySearch.Chop(1, _arrayOfThree));
 }
예제 #10
0
 public void TestSingle()
 {
     Assert.AreEqual(-1, BinarySearch.Chop(3, _arrayOfOne));
     Assert.AreEqual(0, BinarySearch.Chop(1, _arrayOfOne));
 }
예제 #11
0
 public void TestEmpty()
 {
     Assert.AreEqual(-1, BinarySearch.Chop(3, _arrayEmpty));
 }
예제 #12
0
 public void TestEmpty()
 {
     Assert.Equals(-1, _binarySearch.Chop(3, new int[] { }));
 }