public void RegisterNullCheckPostProcess() { Services.AddMediatRNullCheckPostProcessor(); IRequestPostProcessor <BarRequest, BarRequest.BarResponse> behavior = Provider.GetRequiredService <IRequestPostProcessor <BarRequest, BarRequest.BarResponse> >(); behavior.Should().BeAssignableTo <NullCheckPostProcessor <BarRequest, BarRequest.BarResponse> >(); }
public void RegisterNullCheckPostProcessWithIgnoringType() { Services.AddMediatRNullCheckPostProcessor((o) => o.IgnoreRequest <IRequest <string> >()); IRequestPostProcessor <IRequest <string>, string> behavior = Provider.GetRequiredService <IRequestPostProcessor <IRequest <string>, string> >(); Action action = () => behavior.Process(null, null, CancellationToken.None); action.Should().NotThrow <NotFoundException>(); }