public void ArraySearchSortedNoSize2BinarySearchCompleteTestNullArray() { try { ArraySearchSortedNoSize2BinarySearchComplete.Search(null, 23); } catch (ArgumentException) { Assert.IsTrue(true); return; } Assert.Fail(); }
public void ArraySearchSortedNoSize2BinarySearchCompleteTestNegativeIndex() { try { var listy = new Listy(new[] { 3, 5, 7, 7, 8, 23, 38, 56 }); ArraySearchSortedNoSize2BinarySearchComplete.Search(listy, -2); } catch (ArgumentException) { Assert.IsTrue(true); return; } Assert.Fail(); }
public void ArraySearchSortedNoSize2BinarySearchCompleteTestOneElementNotFound() { var listy = new Listy(new[] { 3 }); Assert.AreEqual(-1, ArraySearchSortedNoSize2BinarySearchComplete.Search(listy, 23)); }
public void ArraySearchSortedNoSize2BinarySearchCompleteTestEmptyLists() { var listy = new Listy(new int[0]); Assert.AreEqual(-1, ArraySearchSortedNoSize2BinarySearchComplete.Search(listy, 23)); }
public void ArraySearchSortedNoSize2BinarySearchCompleteTestValueNotFound() { var listy = new Listy(new[] { 3, 5, 7, 7, 8, 23, 38, 56 }); Assert.AreEqual(-1, ArraySearchSortedNoSize2BinarySearchComplete.Search(listy, 100)); }