Exemplo n.º 1
0
        public void AddOrderWithValidState()
        {
            TaxManager om = new TaxManager(new MockStateTaxRepository());
            Order order = new Order();
            order.StateTax.StateAbbreviation = "OH";
            var response = om.AddState(order);

            Assert.AreEqual(true, response.Success);
            Assert.AreEqual(AddOrderStatus.Ok, response.Status);
        }
Exemplo n.º 2
0
        public void CheckCalculation()
        {
            TaxManager tm = new TaxManager(new MockStateTaxRepository());
            ProductManager om = new ProductManager(new MockProductRepository());
            Order order = new Order();
            order.Product.ProductType = "Wood";
            order.StateTax.StateAbbreviation = "OH";
            order.Area = 100;
            om.AssignProductValues(order);
            tm.AssignStateValues(order);
            OrderCostCalculation.Execute(order);

            Assert.AreEqual(1000.00M, order.OrderCost.MaterialCost);
            Assert.AreEqual(1400.00M, order.OrderCost.LaborCost);
            Assert.AreEqual(180.00M, order.OrderCost.Tax);
            Assert.AreEqual(2580.00M, order.OrderCost.Total);
        }