Пример #1
0
        public void CheckOrderNumber(int orderNumber, int expectedOrderNumber)
        {
            Order order = new Order()
            {
                OrderDate    = DateTime.Parse("01/20/2020"),
                Area         = 100,
                ProductType  = "Carpet",
                State        = "PA",
                CustomerName = "Anthony",
                OrderNumber  = orderNumber
            };

            TestRepository   orderRepository = new TestRepository();
            FlooringServices services        = new FlooringServices(orderRepository);
            AddOrderResponse response        = services.Add(order);

            Assert.AreEqual(expectedOrderNumber, response.order.OrderNumber);
        }
Пример #2
0
        [TestCase("Anthony", "PA", "Carpet", 20, 2.25, 2.10, false)]   //invalid area

        public void AddOrderTest(string name, string state, string product, decimal area, decimal CostPerSquareFoot, decimal laborCostPerSquareFoot, bool expectedResult)
        {
            Order order = new Order()
            {
                CustomerName           = name,
                State                  = state,
                ProductType            = product,
                Area                   = area,
                CostPerSquareFoot      = CostPerSquareFoot,
                LaborCostPerSquareFoot = laborCostPerSquareFoot
            };

            AddOrderResponse response        = new AddOrderResponse();
            TestRepository   orderRepository = new TestRepository();
            FlooringServices services        = new FlooringServices(orderRepository);

            response = services.Add(order);

            Assert.AreEqual(expectedResult, response.Success);
        }