public void IsCritical_WithExceptionType_Succeeds() { // Act var filter = new CriticalExceptionFilter( typeof(AuthenticationException), exception => exception is AuthenticationException); // Assert Assert.True(filter.IsCritical(new AuthenticationException())); Assert.False(filter.IsCritical(new AccessViolationException())); Assert.Equal(typeof(AuthenticationException), filter.ExceptionType); }
public void IsCritical_WithoutException_Throws() { // Arrange var filter = new CriticalExceptionFilter(typeof(AuthenticationException), ex => true); // Act / Assert Assert.ThrowsAny <ArgumentException>(() => filter.IsCritical(exception: null)); }