public void RejectReturnsCorrectResult(MakeReservationCommand sut)
 {
     var expected = sut.AsSource().OfLikeness<ReservationRejectedEvent>();
     ReservationRejectedEvent result = sut.Reject();
     expected.ShouldEqual(result);
 }
 public void ConsumePublishesEvent([Frozen]Mock<IChannel> channelMock, RejectingReservationConsumer sut, MakeReservationCommand cmd)
 {
     var expectedEvent = cmd.Reject().AsSource().OfLikeness<ReservationRejectedEvent>();
     sut.Consume(cmd);
     channelMock.Verify(c => c.Send(expectedEvent));
 }
 public void NameIsCorrect([Frozen]string name, MakeReservationCommand sut)
 {
     Assert.Equal<string>(name, sut.Name);
 }
 public void QuantityIsCorrect([Frozen]int quantity, MakeReservationCommand sut)
 {
     Assert.Equal<int>(quantity, sut.Quantity);
 }
 public void IdIsUnique(MakeReservationCommand sut, MakeReservationCommand other)
 {
     Assert.NotEqual<Guid>(other.Id, sut.Id);
 }
 public void IdIsStable(MakeReservationCommand sut)
 {
     Assert.Equal(sut.Id, sut.Id);
 }
 public void EmailIsCorrect([Frozen]string email, MakeReservationCommand sut)
 {
     Assert.Equal<string>(email, sut.Email);
 }
 public void DateIsCorrect([Frozen]DateTime date, MakeReservationCommand sut)
 {
     Assert.Equal<DateTime>(date, sut.Date);
 }
 public void ConsumeAddsReservationToRepository([Frozen]Mock<IReservationRepository> repositoryMock, ReservationWriter sut, MakeReservationCommand cmd)
 {
     var expectedReseveration = cmd.Accept().AsSource().OfLikeness<ReservationAcceptedEvent>();
     sut.Consume(cmd);
     repositoryMock.Verify(r => r.AddReservation(It.Is<ReservationAcceptedEvent>(e => expectedReseveration.Equals(e))));
 }