Пример #1
0
        public void ScenarioB()
        {
            MockProductServices mockProductServices = new MockProductServices();
            List <MockProduct>  products            = new List <MockProduct>();
            List <string>       inputs = new List <string>();

            inputs.Add("A");
            inputs.Add("A");
            inputs.Add("A");
            inputs.Add("A");
            inputs.Add("A");
            inputs.Add("B");
            inputs.Add("B");
            inputs.Add("B");
            inputs.Add("B");
            inputs.Add("B");
            inputs.Add("C");

            foreach (var item in inputs)
            {
                MockProduct p = mockProductServices.GetPriceByType(item);
                products.Add(p);
            }

            int totalPrice = mockProductServices.GetTotalPrice(products);

            Assert.AreEqual(370, totalPrice);
        }
Пример #2
0
        public void TowofB()
        {
            MockProductServices mockProductServices = new MockProductServices();
            List <MockProduct>  products            = new List <MockProduct>();
            int orders = 2;

            for (int i = 0; i < orders; i++)
            {
                string      input = "B";
                string      type  = input.ToUpper();
                MockProduct p     = mockProductServices.GetPriceByType(type);
                products.Add(p);
            }
            int totalPrice = mockProductServices.GetTotalPrice(products);

            Assert.AreEqual(45, totalPrice);
        }