Ejemplo n.º 1
0
        public void RegisterNullCheckPostProcess()
        {
            Services.AddMediatRNullCheckPostProcessor();

            IRequestPostProcessor <BarRequest, BarRequest.BarResponse> behavior =
                Provider.GetRequiredService <IRequestPostProcessor <BarRequest, BarRequest.BarResponse> >();

            behavior.Should().BeAssignableTo <NullCheckPostProcessor <BarRequest, BarRequest.BarResponse> >();
        }
Ejemplo n.º 2
0
        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>();
        }