Ejemplo n.º 1
0
        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));
        }
Ejemplo n.º 2
0
        public int?BinarySearchTest(int[] input, int x)
        {
            var calc = new BinarySearcherIterative();

            return(calc.BinarySearch(input, x));
        }