public void ShouldCombineSpecialInstructions() { var e = new MockEntree(0, 0); e.AddInstruction("Entree instruction"); var s = new MockSide(0, 0); s.AddInstruction("Side instruction"); var d = new MockDrink(0, 0); d.AddInstruction("Drink instruction"); var c = new Combo() { Entree = e, Side = s, Drink = d }; Assert.Equal(6, c.SpecialInstructions.Count); Assert.Collection(c.SpecialInstructions, item => Assert.Equal("Mock Entree", item), item => Assert.Equal(" - Entree instruction", item), item => Assert.Equal("Mock Side", item), item => Assert.Equal(" - Side instruction", item), item => Assert.Equal("Mock Drink", item), item => Assert.Equal(" - Drink instruction", item) ); }
public void ShouldNotifySpecialInstructionsChangedWhenDrinkSpecialInstructionsChanged() { var c = new Combo(); var d = new MockDrink(0, 0); c.Drink = d; Assert.PropertyChanged(c, nameof(Combo.SpecialInstructions), () => { d.AddInstruction("Test"); }); }
public void ShouldCorrectlyGenerateReciept() { var order = new Order(); var entree = new MockEntree(5.00, 100); var drink = new MockDrink(1.00, 600); drink.AddInstruction("Hold ice"); order.Add(entree); order.Add(drink); // Card paid reciept var reciept = RecieptGenerator.GenerateReciept(order, false); Assert.Collection(reciept, item => Assert.Contains("Order ", item), item => Assert.Contains("Submitted at ", item), item => Assert.Equal("Mock Entree - $5.00", item), item => Assert.Equal("Mock Drink - $1.00", item), item => Assert.Equal("Hold ice", item), item => Assert.Equal("Subtotal: $6.00", item), item => Assert.Equal("Tax: $0.72", item), item => Assert.Equal("Total: $6.72", item), item => Assert.Equal("Paid with card", item) ); // Cash paid reciept reciept = RecieptGenerator.GenerateReciept(order, true, 2.00); Assert.Collection(reciept, item => Assert.Contains("Order ", item), item => Assert.Contains("Submitted at ", item), item => Assert.Equal("Mock Entree - $5.00", item), item => Assert.Equal("Mock Drink - $1.00", item), item => Assert.Equal("Hold ice", item), item => Assert.Equal("Subtotal: $6.00", item), item => Assert.Equal("Tax: $0.72", item), item => Assert.Equal("Total: $6.72", item), item => Assert.Equal("Paid with cash", item), item => Assert.Equal("Change owed: $2.00", item) ); }