Beispiel #1
0
        public void ThirdSearch_Test_valueExists_another_boundary()
        {
            //arrange
            int[] exampleArray = { 9, 8, 55, 3, -13, 56, 101, 2, 0, 1000 };
            int   ValueToFind  = 1000;
            //act

            int returnedIndex = SortAndSearch.ThirdSearch(exampleArray, ValueToFind);

            //assert

            Assert.AreEqual(returnedIndex, 9);
        }
Beispiel #2
0
        public void ThirdSearch_Test_array_with_same_values()
        {
            //arrange
            int[] exampleArray = { 100, 100, 100, 100, 100, 100, 100, 100, 100 };

            int ValueToFind = 100;       // not exists
            //act


            int returnedIndex = SortAndSearch.ThirdSearch(exampleArray, ValueToFind);

            //assert

            Assert.AreEqual(returnedIndex, 0);
        }
Beispiel #3
0
        public void ThirdSearch_Test_valueNotExists()
        {
            //arrange
            int[] exampleArray = { 9, 8, 55, 3, -13, 56, 101, 2, 0, 1000 };

            int ValueToFind = 88;       // not exists
            //act


            int returnedIndex = SortAndSearch.ThirdSearch(exampleArray, ValueToFind);

            //assert

            Assert.AreEqual(returnedIndex, -1);
        }