public void ReturnNullGivenExceptionIsNotOfType() { // Arrange var exception = new NullReferenceException(); // Act var returnedException = exception.GetFirstExceptionOfType<NotImplementedException>(); // Assert Assert.IsTrue(returnedException == null); }
public void ReturnNullGivenExceptionDoesNotContainType() { // Arrange var innerException = new NullReferenceException(); var exception = new NullReferenceException("Test", innerException); // Act var returnedException = exception.GetFirstExceptionOfType<FileNotFoundException>(); // Assert Assert.IsTrue(returnedException == null); }