コード例 #1
0
 public void ThenTheEventsForCreatingTheSeatTypeAreEmitted()
 {
     foreach (var seat in seats)
     {
         Assert.True(MessageLogHelper.CollectEvents <SeatCreated>(seat.Id, 1));
     }
 }
コード例 #2
0
        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
            }
        }
コード例 #3
0
        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));
        }
コード例 #4
0
        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());
        }
コード例 #5
0
 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");
 }
コード例 #8
0
 public void ThenTheEventForConfirmingTheOrderIsEmitted()
 {
     Assert.True(MessageLogHelper.CollectEvents <OrderConfirmed>(orderId, 1));
 }
コード例 #9
0
 public void ThenTheEventForConfirmingThePaymentIsEmitted()
 {
     Assert.True(MessageLogHelper.CollectEvents <PaymentCompleted>(paymentId, 1));
 }