예제 #1
0
        public ReservaCommadResultRegister Salvar(ReservaCommandRegister commad)
        {
            var reserva = _repository.GetReservaSala(commad);

            if (reserva.Count() == 0)
            {
                var result = _handle.Handle(commad);
                return(result);
            }
            return(null);
        }
예제 #2
0
        public void Dado_um_CreateReservaCommand_valido_a_reserva_deve_ser_criada()
        {
            var sessao    = _sessaoRepository.GetById(Guid.NewGuid());
            var poltronas = sessao.Poltrona.ToList();

            var ingressos = new List <CreateIngressoCommand>()
            {
                new CreateIngressoCommand("Jose", poltronas[0].Id),
                new CreateIngressoCommand("Amanda", poltronas[1].Id),
                new CreateIngressoCommand("Erika", poltronas[2].Id)
            };

            var command       = new CreateReservaCommand(Guid.NewGuid(), sessao.Id, ingressos);
            var commandResult = (GenericCommandResult)_handler.Handle(command);

            Assert.IsTrue(commandResult.Sucess);
        }