public void BinarySearchExceptionsTest() { var calc = new BinarySearcherIterative(); Assert.Throws(typeof(ArgumentNullException), () => calc.BinarySearch(null, 0)); Assert.Throws(typeof(ApplicationException), () => calc.BinarySearch(new int[0], 3)); }
public int?BinarySearchTest(int[] input, int x) { var calc = new BinarySearcherIterative(); return(calc.BinarySearch(input, x)); }