Пример #1
0
        public void CanAdd()
        {
            repo.CreateOrder(date, order);

            List <Orders> orders = repo.LoadOrders(date);

            Assert.AreEqual(3, orders.Count);

            Orders check = orders.FirstOrDefault(o => o.OrderNumber == 2);

            Assert.AreEqual(2, check.OrderNumber);
            Assert.AreEqual("Tou", check.CustomerName);
            Assert.AreEqual("IN", check.State);
            Assert.AreEqual(6.25, check.TaxRate);
            Assert.AreEqual("Tile", check.ProductType);
            Assert.AreEqual(100, check.Area);
            Assert.AreEqual(5.15, check.CostPerSquareFoot);
            Assert.AreEqual(4.75, check.LaborCostPerSquareFoot);
            Assert.AreEqual(515.00, check.MaterialCost);
            Assert.AreEqual(475, check.LaborCost);
            Assert.AreEqual(61.88, check.Tax);
            Assert.AreEqual(1051.88, check.Total);

            repo.DeleteOrder(order);
        }
Пример #2
0
        public void CanDelete()
        {
            repo = new OrderTestRepository();
            Orders order = new Orders()
            {
                OrderNumber = 2
            };

            repo.DeleteOrder(order);

            List <Orders> orders = repo.LoadOrders(date);

            Assert.AreEqual(1, orders.Count);

            Orders check = orders.FirstOrDefault(o => o.OrderNumber == 1);

            Assert.AreEqual(1, check.OrderNumber);
            Assert.AreEqual("Wise", check.CustomerName);
            Assert.AreEqual("OH", check.State);
            Assert.AreEqual(6.25, check.TaxRate);
            Assert.AreEqual("Wood", check.ProductType);
            Assert.AreEqual(100, check.Area);
            Assert.AreEqual(5.15, check.CostPerSquareFoot);
            Assert.AreEqual(4.75, check.LaborCostPerSquareFoot);
            Assert.AreEqual(515.00, check.MaterialCost);
            Assert.AreEqual(475, check.LaborCost);
            Assert.AreEqual(61.88, check.Tax);
            Assert.AreEqual(1051.88, check.Total);

            repo.CreateOrder(date, order);
        }