public async Task WhenAMessageIsHandled_TheInnerResultTrueIsReturned()
        {
            var inner = Substitute.For<IHandler<OrderAccepted>>();
            inner.Handle(Arg.Any<OrderAccepted>())
                .Returns(true);

            var handler = new BlockingHandler<OrderAccepted>(inner);

            var message = new OrderAccepted();

            var result = await handler.Handle(message);

            Assert.That(result, Is.True);
        }
        public async Task WhenAMessageIsHandled_TheInnerIsCalled()
        {
            var inner = Substitute.For<IHandler<OrderAccepted>>();
            inner.Handle(Arg.Any<OrderAccepted>())
                .Returns(false);

            var handler = new BlockingHandler<OrderAccepted>(inner);

            var message = new OrderAccepted();

            await handler.Handle(message);

            inner.Received().Handle(message);
        }
예제 #3
0
        public async Task WhenAMessageIsHandled_TheInnerIsCalled()
        {
            var inner = Substitute.For <IHandler <OrderAccepted> >();

            inner.Handle(Arg.Any <OrderAccepted>())
            .Returns(false);

            var handler = new BlockingHandler <OrderAccepted>(inner);

            var message = new OrderAccepted();

            await handler.Handle(message);

            inner.Received().Handle(message);
        }
예제 #4
0
        public async Task WhenAMessageIsHandled_TheInnerResultTrueIsReturned()
        {
            var inner = Substitute.For <IHandler <OrderAccepted> >();

            inner.Handle(Arg.Any <OrderAccepted>())
            .Returns(true);

            var handler = new BlockingHandler <OrderAccepted>(inner);

            var message = new OrderAccepted();

            var result = await handler.Handle(message);

            Assert.That(result, Is.True);
        }
예제 #5
0
        public async Task WhenAMessageIsHandled_TheInnerResultFalseIsReturned()
        {
            var inner = Substitute.For <IHandler <OrderAccepted> >();

            inner.Handle(Arg.Any <OrderAccepted>())
            .Returns(false);

            var handler = new BlockingHandler <OrderAccepted>(inner);

            var message = new OrderAccepted();

            var result = await handler.Handle(message);

            result.ShouldBeFalse();
        }