Ejemplo n.º 1
0
        public void Reserve(string customer, IEnumerable <Seat> seats)
        {
            if (SeatsAreReserved(seats))
            {
                _publish(new SeatsNotReserved(customer, seats, "The seats are not available"));

                return;
            }

            _publish(new SeatsReserved(customer, seats, _state.ToString()));
        }
Ejemplo n.º 2
0
        public void WhenCustomerReservesSeats(string customer, string seats)
        {
            var sut = new ReserveSeatsCommandHandler(_events, (@event) =>
            {
                _publishedEvents.Add(@event);

                _events.Add(@event);
            });

            sut.Handle(new ReserveSeats(seats.ToSeats(), customer, _screening.ToString()));
        }