Пример #1
0
        public void Order_TwoOrderLinesChangeSelection_TotalPrice1()
        {
            // Arrange
            var order = new Order();
            var line1 = new OrderLine
            {
                Price = _price1,
                ProductName = "Ms",
                Selected = false
            };
            var line2 = new OrderLine
            {
                Price = _price1,
                ProductName = "Apple",
                Selected = false
            };
            order.OrderLines.Add(line1);
            order.OrderLines.Add(line2);

            // Act
            line2.Selected = true;

            // Assert
            Assert.AreEqual(_price1 + _price1, order.TotalPrice);
            Assert.AreEqual(_price1, order.TotalSelectdPrice);
        }
Пример #2
0
        public void Order_OneUnselectedOrderLine_TotalPrice1()
        {
            // Arrange
            var order = new Order();
            var line1 = new OrderLine
            {
                Price = _price1,
                ProductName = "Ms",
                Selected = false
            };

            // Act
            order.OrderLines.Add(line1);

            // Assert
            Assert.AreEqual(_price1, order.TotalPrice);
            Assert.AreEqual(_nothingSelectedPrice, order.TotalSelectdPrice);
        }