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); }
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); }
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); }
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(); }