Ejemplo n.º 1
0
        public void ShouldRemoveImmutably()
        {
            //Arrange
            Toppings  initial  = new Toppings();
            IToppings multiple = initial.Add(Topping.Mushroom).Add(Topping.Mozzarella);

            //Act
            IToppings removed = multiple.Remove(Topping.Mushroom);

            //Assert
            removed.Cost(new Money(10)).Should().Be(new Money(1));
            multiple.Cost(new Money(10)).Should().Be(new Money(2));
        }
Ejemplo n.º 2
0
 public Money Price() => _basePrice + _toppings.Cost(_basePrice);