Beispiel #1
0
 public CustomerTicketController(CustomerCommandHandler customerCommandHandler,
                                 CustomerQueryHandler customerQueryHandler,
                                 TicketCommandHandler ticketCommandHandler,
                                 TicketQueryHandler ticketQueryHandler)
 {
     _customerCommandHandler = customerCommandHandler;
     _customerQueryHandler   = customerQueryHandler;
     _ticketCommandHandler   = ticketCommandHandler;
     _ticketQueryHandler     = ticketQueryHandler;
 }
Beispiel #2
0
        public void Handle_RegisterTicket_Should_Call_Create_On_Repository()
        {
            //Arrange
            var ticket           = new TicketTestBuilder().Build();
            var registerTicket   = ProvideSomeRegisterTicket();
            var ticketRepository = Substitute.For <ITicketRepository>();

            ticketRepository.Create(ticket);
            var ticketCommandHandler = new TicketCommandHandler(ticketRepository);

            //Act
            ticketCommandHandler.Handle(registerTicket);

            //Assert
            ticketRepository.Received(1).Create(ticket);
        }
 public TicketController(TicketCommandHandler ticketCommandHandler,
                         TicketQueryHandler ticketQueryHandler)
 {
     _ticketCommandHandler = ticketCommandHandler;
     _ticketQueryHandler   = ticketQueryHandler;
 }