Beispiel #1
0
        public void ConsumeRequestWithEnoughCapacitySendsCorrectEvent(
            [Frozen]Mock<ICapacityRepository> repositoryStub,
            [Frozen]Mock<IChannel<ReservationAcceptedEvent>> channelMock,
            CapacityGate sut,
            RequestReservationCommand command,
            Capacity capacity)
        {
            repositoryStub
                .Setup(r => r.Read(It.IsAny<DateTime>()))
                .Returns(capacity.ToMaybe());

            sut.Consume(command);

            var expected = command.Accept().Id;
            channelMock.Verify(c => c.Send(It.Is<ReservationAcceptedEvent>(e => e.Id == expected)));
        }
        public void AcceptReturnsCorrectResult(RequestReservationCommand sut)
        {
            ReservationAcceptedEvent actual = sut.Accept();

            sut.AsSource().OfLikeness<ReservationAcceptedEvent>().ShouldEqual(actual);
        }