示例#1
0
        public void TotalSumTest_300Multiply2_Returns600()
        {
            BasketLine basketLine = new BasketLine {
                Product = product, QuantityOfGoods = quantityOfGoods
            };

            decimal rezult = basketLine.TotalSum();

            Assert.AreEqual(rezult, 600);
        }
示例#2
0
        public void ToStringTest()
        {
            BasketLine basketLine = new BasketLine {
                Product = product, QuantityOfGoods = quantityOfGoods
            };

            string rezult = basketLine.ToString();

            Assert.IsTrue(rezult.Contains(product.Name), "Ошибка в наименовании товара");
            Assert.IsTrue(rezult.Contains(product.Price.ToString()), "Ошибка в поле - цена");
            Assert.IsTrue(rezult.Contains(quantityOfGoods.ToString()), "Ошибка в поле - количество");
            Assert.IsTrue(rezult.Contains(basketLine.TotalSum().ToString()), "Ошибка в поле - общая сумма");
        }