public void ReturnTrueGivenExceptionIsOfType() { // Arrange var exception = new NullReferenceException(); // Act var isOfType = exception.IsOrContainsExceptionOfType <NullReferenceException>(); // Assert Assert.IsTrue(isOfType); }
public void ReturnFalseGivenExceptionIsNotOfType() { // Arrange var exception = new NullReferenceException(); // Act var isOfType = exception.IsOrContainsExceptionOfType <NotImplementedException>(); // Assert Assert.IsFalse(isOfType); }
public void ReturnTrueGivenExceptionContainsType() { // Arrange var innerException = new NotImplementedException(); var exception = new NullReferenceException("Test", innerException); // Act var isOfType = exception.IsOrContainsExceptionOfType <NotImplementedException>(); // Assert Assert.IsTrue(isOfType); }
public void ReturnFalseGivenExceptionDoesNotContainType() { // Arrange var innerException = new NotImplementedException(); var exception = new NullReferenceException("Test", innerException); // Act var isOfType = exception.IsOrContainsExceptionOfType <FileNotFoundException>(); // Assert Assert.IsFalse(isOfType); }