public static IEnumerable <object> Handle(ReservationState _, RequestTickets command)
        {
            var reservationId = Guid.NewGuid();
            var requestedOn   = DateTime.UtcNow;

            yield return(new TicketsRequested(reservationId, command.TicketId, command.QuantityRequested, requestedOn));
        }
        public void RaisesTicketsRequested()
        {
            var state   = ReservationState.Initial;
            var command = new RequestTickets(Guid.NewGuid(), 4);
            var events  = Reservation.Handle(state, command).ToList();

            Assert.Single(events);
            Assert.IsType <TicketsRequested>(events.Single());
        }
Esempio n. 3
0
 public void When(RequestTickets command)
 {
     Console.WriteLine($"\t---Handling {command.GetType().Name}---");
 }