コード例 #1
0
        public void ValorPedidoFinalNaoPodeZerMenorOuIgualAzero()
        {
            var builder = new DbContextOptionsBuilder <DataContext>();

            builder.UseSqlServer(Runtime.ConnectionString);

            this._ingredienteRepository = new IngredienteRepository(new DataContext(builder.Options));
            this._lancheRepository      = new LancheRepository(new DataContext(builder.Options));
            var command = new Commands.Pedido.PedidoCommand()
            {
                IdLanche    = 1,
                ItensPedido = new System.Collections.Generic.List <Commands.Pedido.ItensPedidoCommand> {
                    new Commands.Pedido.ItensPedidoCommand()
                    {
                        IdIngrediente = 3, Quantidade = 3,
                    },
                    new Commands.Pedido.ItensPedidoCommand()
                    {
                        IdIngrediente = 1, Quantidade = 2,
                    },
                    new Commands.Pedido.ItensPedidoCommand()
                    {
                        IdIngrediente = 5, Quantidade = 1,
                    }
                }
            };

            var ret = CalculoCore.Calcular(command, _ingredienteRepository, _lancheRepository);

            Assert.IsFalse(ret.ValorFinal <= 0, "");
        }
コード例 #2
0
 public IDtoResult Calcular(PedidoCommand pedidoCommand)
 {
     return(CalculoCore.Calcular(pedidoCommand, this._ingredienteRepository, this._lancheRepository));
 }