Example #1
0
        public void OrderFromStringTest(string row, int id, string name, string abbreviation, decimal taxRate, string productType, decimal area, decimal materialCostPerSquareFoot, decimal laborCostPerSquareFoot, decimal materialCost, decimal laborCost, decimal taxAmt, decimal total)
        {
            Order actual = OrderMapper.FromString(row);

            Product product = new Product
            {
                ProductType            = productType,
                CostPerSquareFoot      = materialCostPerSquareFoot,
                LaborCostPerSquareFoot = laborCostPerSquareFoot,
            };
            Tax tax = new Tax
            {
                TaxRate           = taxRate,
                StateAbbreviation = abbreviation
            };
            Order expected = new Order()
            {
                OrderNumber  = id,
                CustomerName = name,
                OrderTax     = tax,
                OrderProduct = product,
                Area         = area,
            };

            Assert.AreEqual(expected.OrderTax.StateAbbreviation, actual.OrderTax.StateAbbreviation);
            Assert.AreEqual(expected.OrderTax.TaxRate, actual.OrderTax.TaxRate);

            Assert.AreEqual(expected.OrderProduct.ProductType, actual.OrderProduct.ProductType);
            Assert.AreEqual(expected.OrderProduct.CostPerSquareFoot, actual.OrderProduct.CostPerSquareFoot);
            Assert.AreEqual(expected.OrderProduct.LaborCostPerSquareFoot, actual.OrderProduct.LaborCostPerSquareFoot);

            Assert.AreEqual(expected.OrderNumber, actual.OrderNumber);
            Assert.AreEqual(expected.CustomerName, actual.CustomerName);
            Assert.AreEqual(expected.Area, actual.Area);
            Assert.AreEqual(expected.LaborCost, actual.LaborCost);
            Assert.AreEqual(expected.MaterialCost, actual.MaterialCost);
            Assert.AreEqual(expected.Tax, actual.Tax);
            Assert.AreEqual(expected.Total, actual.Total);
        }