Beispiel #1
0
        public void TestConversaoFormaPagamentoInvalida()
        {
            IVendaEntityFactory vendaEntityFactory = PegarVendaEntityFactory();
            var vendaModel = new VendaModel();

            vendaModel.Cliente          = new ClienteModel(int.MinValue, string.Empty);
            vendaModel.FormaDePagamento = 20;

            Assert.Throws <AutoMapperMappingException>(() =>
                                                       vendaEntityFactory.Criar(vendaModel));
        }
Beispiel #2
0
        public void TestConversaoFormaPagamento()
        {
            IVendaEntityFactory vendaEntityFactory = PegarVendaEntityFactory();
            var vendaModel = new VendaModel();

            vendaModel.Cliente          = new ClienteModel(int.MinValue, string.Empty);
            vendaModel.FormaDePagamento = DINHEIRO;

            VendaEntity venda = vendaEntityFactory.Criar(vendaModel);

            Assert.Equal(FormaDePagamento.Dinheiro, venda.FormaDePagamento);
        }
Beispiel #3
0
 public VendaApplication(IVendaEntityFactory vendaFactory, ISalvarVendaService salvarVendaService) : base()
 {
     _vendaFactory       = vendaFactory;
     _salvarVendaService = salvarVendaService;
 }