public void ThenTheEventsForCreatingTheSeatTypeAreEmitted() { foreach (var seat in seats) { Assert.True(MessageLogHelper.CollectEvents <SeatCreated>(seat.Id, 1)); } }
public void ThenAllTheConferencesAreCreated() { var failureCollector = new ConcurrentBag <string>(); Parallel.ForEach(slugs, s => { var mConf = ConferenceHelper.FindConference(s); if (mConf == null) { failureCollector.Add(string.Format("Conference with slug '{0}' not found in management repository.", s)); return; } var success = MessageLogHelper.CollectEvents <AvailableSeatsChanged>(mConf.Id, seatsInfo.Rows.Count); if (!success) { failureCollector.Add(string.Format("Some seats were not found in Conference '{0}'", mConf.Name)); } }); if (failureCollector.Count > 0) { var sb = new StringBuilder(); failureCollector.ToList().ForEach(s => sb.AppendLine(s)); Assert.True(failureCollector.Count == 0, sb.ToString()); // raise error with all the failures } }
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 ThenTheEventForPublishingTheConferenceIsEmitted() { Assert.True(MessageLogHelper.CollectEvents <ConferencePublished>(conference.Id, 1)); }
public void ThenSomeEventsForPartiallyCompletingTheOrderAreEmitted(int eventCount) { Assert.True(MessageLogHelper.CollectEvents <OrderPartiallyReserved>(orderIds, eventCount), "Timeout for Collecting OrderPartiallyReserved Events"); }
public void ThenOnlySomeEventsForCompletingTheOrderReservationAreEmitted(int eventCount) { Assert.True(MessageLogHelper.CollectEvents <OrderReservationCompleted>(orderIds, eventCount), "Timeout for Collecting OrderReservationCompleted Events"); }
public void ThenTheEventForConfirmingTheOrderIsEmitted() { Assert.True(MessageLogHelper.CollectEvents <OrderConfirmed>(orderId, 1)); }
public void ThenTheEventForConfirmingThePaymentIsEmitted() { Assert.True(MessageLogHelper.CollectEvents <PaymentCompleted>(paymentId, 1)); }