public void OnException_sets_exception_handled_when_entity_not_found() { var sut = new EntityNotFoundExceptionFilterAttribute(); var context = CreateTestContext(new EntityNotFoundException(new StringEntityIdentity())); sut.OnException(context); context.ExceptionHandled.Should().BeTrue(); }
public void OnException_sets_status_code_when_entity_not_found() { var sut = new EntityNotFoundExceptionFilterAttribute(); var context = CreateTestContext(new EntityNotFoundException(new StringEntityIdentity())); sut.OnException(context); context.HttpContext.Response.StatusCode.Should().Be(404); }