Esempio n. 1
0
        public void AddProductWithValidProductType()
        {
            ProductManager om = new ProductManager(new MockProductRepository());
            Order order = new Order();
            order.Product.ProductType = "Wood";
            var response = om.AddProduct(order);

            Assert.AreEqual(true, response.Success);
            Assert.AreEqual(AddOrderStatus.Ok, response.Status);
        }
        public void GetLaborCostPerSqFtTestSucceeds()
        {
            string mode = "File";
            string productPath = @"DataFiles\Products\";

            var manager = new ProductManager(mode, productPath);

            var result = manager.GetLaborCostPerSqFt("Tile");

            Assert.AreEqual(result, 4.15m);
        }
        public void getCostPerSqFtTest()
        {
            string mode = "File";
            string productPath = @"DataFiles\Products\";

            var manager = new ProductManager(mode, productPath);

            var result = manager.GetCostPerSqFt("Tile");

            Assert.AreEqual(result, 3.50m);
        }
Esempio n. 4
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);
        }