public given_a_placed_order()
            {
                this.orderPlaced = new OrderPlaced
                {
                    SourceId = orderId,
                    ReservationAutoExpiration = DateTime.UtcNow.AddMinutes(10),
                    Version = 2,
                };

                this.sut.Handle(orderPlaced);
            }
 public when_order_is_placed()
 {
     this.orderPlaced = new OrderPlaced
                            {
                                SourceId = Guid.NewGuid(),
                                ConferenceId = Guid.NewGuid(),
                                Seats = new[] { new SeatQuantity(Guid.NewGuid(), 2) },
                                ReservationAutoExpiration = DateTime.UtcNow.Add(TimeSpan.FromMinutes(22))
                            };
     sut.Handle(orderPlaced);
 }
Exemplo n.º 3
0
        public given_an_order()
        {
            this.placed = new OrderPlaced
            {
                ConferenceId = Guid.NewGuid(),
                SourceId = Guid.NewGuid(),
                AccessCode = "asdf",
            };

            this.sut = new OrderEventHandler(() => new ConferenceContext(dbName));
            this.sut.Handle(placed);
        }
        public void WhenTheEventForOrderPlacedIsEmitted()
        {
            var orderPlaced = new OrderPlaced
            {
                SourceId = orderId,
                ConferenceId = registerToConference.ConferenceId,
                Seats = registerToConference.Seats,
                ReservationAutoExpiration = DateTime.UtcNow.Add(TimeSpan.FromSeconds(5)),
                AccessCode = HandleGenerator.Generate(6)
            };

            eventBus.Publish(orderPlaced);
        }
Exemplo n.º 5
0
        public void when_order_placed_then_creates_order_entity()
        {
            var e = new OrderPlaced
            {
                ConferenceId = Guid.NewGuid(),
                SourceId = Guid.NewGuid(),
                AccessCode = "asdf",
            };

            this.sut.Handle(e);

            using (var context = new ConferenceContext(dbName))
            {
                var order = context.Orders.Find(e.SourceId);

                Assert.NotNull(order);
            }
        }
Exemplo n.º 6
0
 private void OnOrderPlaced(OrderPlaced e)
 {
     this.conferenceId = e.ConferenceId;
     this.seats = e.Seats.ToList();
 }
        public void WhenTheEventForOrderPlacedGetExpired()
        {
            //Update the registration data
            WhenTheCommandToRegisterTheSelectedOrderItemsIsLost();

            var orderPlaced = new OrderPlaced
            {
                SourceId = orderId,
                ConferenceId = registerToConference.ConferenceId,
                Seats = registerToConference.Seats,
                ReservationAutoExpiration = DateTime.UtcNow.Subtract(TimeSpan.FromMinutes(14)),
                AccessCode = HandleGenerator.Generate(6)
            };

            eventBus.Publish(orderPlaced);
        }