Esempio n. 1
0
        public void WorksWithEmptyArray_Test()
        {
            var array             = new int[0];
            var findSecondLargest = new SecondLargest();

            var secondLargest = findSecondLargest.Find2ndLargest(array);
            var expected      = int.MinValue;

            Assert.Equal(expected, secondLargest);
        }
Esempio n. 2
0
        public void FindsSecondLargest_Test()
        {
            var array             = new int[] { -1, 10, 8, 9, 10, 9, -8, 11 };
            var findSecondLargest = new SecondLargest();

            var secondLargest = findSecondLargest.Find2ndLargest(array);
            var expected      = 10;

            Assert.Equal(expected, secondLargest);
        }
Esempio n. 3
0
        public void WorksWithSingleElementArray_Test()
        {
            var array             = new int[] { 1 };
            var findSecondLargest = new SecondLargest();

            var secondLargest = findSecondLargest.Find2ndLargest(array);
            var expected      = int.MinValue + 1;

            Assert.Equal(expected, secondLargest);
        }
Esempio n. 4
0
        static void Main(string[] args)
        {
            var obj = new LargestElementArray();
            //obj.Find();

            var obj2 = new MaxMinArray();
            //obj2.Find();

            var obj3 = new SecondLargest();

            obj3.Find();


            Console.ReadLine();
        }