public void ThenTheEventForCalculatingTheTotalIsEmitted(decimal total) { var orderTotalsCalculated = MessageLogHelper.GetEvents <OrderTotalsCalculated>(orderId).SingleOrDefault(); Assert.NotNull(orderTotalsCalculated); Assert.Equal(total, orderTotalsCalculated.Total); Assert.False(orderTotalsCalculated.IsFreeOfCharge); }
public void ThenTheEventForCompletingTheOrderReservationIsEmitted() { var orderReservationCompleted = MessageLogHelper.GetEvents <OrderReservationCompleted>(orderId).SingleOrDefault(); Assert.NotNull(orderReservationCompleted); Assert.Equal(registerToConference.Seats.Count, orderReservationCompleted.Seats.Count()); Assert.True(orderReservationCompleted.ReservationExpiration > DateTime.Now); }
public void ThenTheEventForOrderPlacedIsEmitted() { Assert.True(MessageLogHelper.CollectEvents <OrderPlaced>(orderId, 1)); var orderPlaced = MessageLogHelper.GetEvents <OrderPlaced>(orderId).Single(); Assert.True(orderPlaced.Seats.All( os => registerToConference.Seats.Count(cs => cs.SeatType == os.SeatType && cs.Quantity == os.Quantity) == 1)); }
public void ThenTheEventForReservingTheSelectedSeatsIsEmitted() { registerToConference = registerToConference ?? ScenarioContext.Current.Get <RegisterToConference>(); // Wait and Check for SeatsReserved event was emitted Assert.True(MessageLogHelper.CollectEvents <SeatsReserved>(registerToConference.ConferenceId, 1)); var seatsReserved = MessageLogHelper.GetEvents <SeatsReserved>(registerToConference.ConferenceId).SingleOrDefault(); Assert.NotNull(seatsReserved); Assert.Equal(registerToConference.Seats.Count, seatsReserved.AvailableSeatsChanged.Count()); }
public void ThenTheseOrderItemsShouldNotBeReserved(Table table) { var orderReservationCompleted = MessageLogHelper.GetEvents <OrderReservationCompleted>(orderId).SingleOrDefault(); Assert.NotNull(orderReservationCompleted); var conferenceInfo = ScenarioContext.Current.Get <ConferenceInfo>(); foreach (var row in table.Rows) { var seat = conferenceInfo.Seats.FirstOrDefault(s => s.Description == row["seat type"]); Assert.NotNull(seat); Assert.False(orderReservationCompleted.Seats.Any(s => s.SeatType == seat.Id)); } }
public void ThenTheEventForConfirmingTheOrderIsNotEmitted() { Assert.False(MessageLogHelper.GetEvents <OrderConfirmed>(orderId).ToList().Any()); }