public void TestSmallestWithNullReferenceException() { ExceptionHandlingCase exceptionHandlingCase = new ExceptionHandlingCase(); int[] arr = null; //Act int actualValue = exceptionHandlingCase.Smallest(arr); }
public void TestSmallestWithSizeZero() { ExceptionHandlingCase exceptionHandlingCase = new ExceptionHandlingCase(); int[] arr = { 12 }; int expectedValue = 12; //Act int actualValue = exceptionHandlingCase.Smallest(arr); //Assert Assert.AreEqual(expectedValue, actualValue); }
public void TestSmallest() { ExceptionHandlingCase exceptionHandlingCase = new ExceptionHandlingCase(); int[] arr = { 12, 6, 8, 1, 7, 9, 23 }; int expectedValue = 1; //Act int actualValue = exceptionHandlingCase.Smallest(arr); //Assert Assert.AreEqual(expectedValue, actualValue); }
public void TestSmallestWithNullValue() { try { ExceptionHandlingCase exceptionHandlingCase = new ExceptionHandlingCase(); int[] arr = null; //Act int actualValue = exceptionHandlingCase.Smallest(arr); } catch (Exception e) { //Assert throw new AssertFailedException(e.Message, e); } }