public void DoNotThrowExceptionWhenResponseIsNotNull() { var postProcessor = new NullCheckPostProcessor <string, string>(NullCheckPostProcessorOptions.Default); Action action = () => postProcessor.Process("request", "response", CancellationToken.None); action.Should().NotThrow <NotFoundException>(); }
public void ThrowExceptionWhenResponseIsNull() { var postProcessor = new NullCheckPostProcessor <IRequest <string>, string>(NullCheckPostProcessorOptions.Default); Action action = () => postProcessor.Process(null, null, CancellationToken.None); action.Should().Throw <NotFoundException>(); }
public void DoNotCheckResponseIfNullCheckIgnoreIsSet() { var options = new NullCheckPostProcessorOptions(); options.IgnoreRequest <Request>(); var postProcessor = new NullCheckPostProcessor <Request, string>(options); Action action = () => postProcessor.Process(new Request(), null, CancellationToken.None); action.Should().NotThrow <NotFoundException>(); }