public void ThirdMaxTests() { ThirdMaximumNumber obj = new ThirdMaximumNumber(); //Input: [3, 2, 1] //Output: 1 var arr = new int[] { 3, 2, 1 }; var x = obj.ThirdMax(arr); arr = new int[] { 1, 2 }; x = obj.ThirdMax(arr);//2 arr = new int[] { 2, 2, 3, 1 }; x = obj.ThirdMax(arr);//1 arr = new int[] { 1, 2, int.MinValue }; x = obj.ThirdMax(arr);//int.MinValue arr = new int[] { 1, int.MinValue, 2 }; x = obj.ThirdMax(arr);//int.MinValue arr = new int[] { int.MinValue, 1, int.MinValue }; x = obj.ThirdMax(arr);//1 arr = new int[] { int.MinValue, 1, 2, int.MinValue }; x = obj.ThirdMax(arr);//int.MinValue arr = new int[] { 1, 2, 3, int.MinValue }; x = obj.ThirdMax(arr);//1 arr = new int[] { 2, int.MinValue }; x = obj.ThirdMax(arr);//2 }
public void ThirdMaximumNumberTestCase8() { var testData = new[] { 3, 2, 3, 1, 2, 4, 5, 5, 6 }; var result = ThirdMaximumNumber.ThirdMax(testData); result.Should().Be(4); }
public void ThirdMaximumNumberTestCase7() { var testData = new[] { 5, 2, 4, 1, 3, 6, 0 }; var result = ThirdMaximumNumber.ThirdMax(testData); result.Should().Be(4); }
public void ThirdMaximumNumberTestCase6() { var testData = new[] { 1, 2, 2, 5, 3, 5 }; var result = ThirdMaximumNumber.ThirdMax(testData); result.Should().Be(2); }
public void ThirdMaximumNumberTestCase3() { var testData = new[] { 2, 2, 3, 1 }; var result = ThirdMaximumNumber.ThirdMax(testData); result.Should().Be(1); }
public void BeforeEach() { ThirdMaximumNumber = new ThirdMaximumNumber(); }