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); }
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); }
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_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(); }