public void ShouldHaveCorrectSpecials() { Brontowurst b = new Brontowurst(); b.HoldBun(); Assert.Collection(b.Special, item => { Assert.Equal("Hold Bun", item); }); b.bun = true; b.HoldOnion(); Assert.Collection(b.Special, item => { Assert.Equal("Hold Onion", item); }); b.onions = true; b.HoldPeppers(); Assert.Collection(b.Special, item => { Assert.Equal("Hold Pepper", item); }); b.HoldBun(); b.HoldOnion(); string[] specials = new string[] { "Hold Bun", "Hold Pepper", "Hold Onion" }; Assert.Equal(b.Special, specials); }
public void HoldOnionShouldNotifyofSpecialPropertyChange() { Brontowurst bw = new Brontowurst(); bw.HoldOnion(); Assert.PropertyChanged(bw, "Special", () => { bw.HoldOnion(); }); }
private void OnHoldOnion(object sender, RoutedEventArgs args) { if (bw != null) { bw.HoldOnion(); } else if (combo != null) { if (combo.Entree is Brontowurst bw) { bw.HoldOnion(); combo.Entree = bw; } } }
public void SpecialShouldHaveHoldOnion() { Brontowurst bw = new Brontowurst(); bw.HoldOnion(); Assert.Collection <string>(bw.Special, item => { Assert.Equal("Hold Onions", item); }); }
public void BrontowurstSpecialPropertiesShouldWorkProperly() { Brontowurst bw = new Brontowurst(); Assert.Empty(bw.Special); bw.HoldBun(); Assert.Contains <string>("Hold Bun", bw.Special); bw = new Brontowurst(); bw.HoldOnion(); Assert.Contains <string>("Hold Onion", bw.Special); bw = new Brontowurst(); bw.HoldPeppers(); Assert.Contains <string>("Hold Peppers", bw.Special); bw = new Brontowurst(); bw.HoldBun(); bw.HoldOnion(); bw.HoldPeppers(); Assert.Contains <string>("Hold Bun", bw.Special); Assert.Contains <string>("Hold Onion", bw.Special); Assert.Contains <string>("Hold Peppers", bw.Special); }
public void BrontowurstNotifyPropertyChanged() { Brontowurst brontowurst = new Brontowurst(); Assert.PropertyChanged(brontowurst, "Price", () => { brontowurst.Price = 10; }); Assert.PropertyChanged(brontowurst, "Calories", () => { brontowurst.Calories = 10; }); System.Action[] actions = { () => { brontowurst.HoldBun(); }, () => { brontowurst.HoldPeppers(); }, () => { brontowurst.HoldOnion(); }, }; string[] properties = { "Special", "Ingredients" }; foreach (System.Action action in actions) { foreach (string property in properties) { Assert.PropertyChanged(brontowurst, property, action); } } }
public void HoldOnionsShouldAddSpecial() { Brontowurst bw = new Brontowurst(); bw.HoldOnion(); Assert.Contains("Hold Onions", bw.Special); }
public void HoldOnionAddsHoldOnionToSpecial() { Brontowurst entree = new Brontowurst(); entree.HoldOnion(); Assert.Equal("Hold Onion", entree.Special[0]); }
public void AddOnionShouldAddOnion() { Brontowurst bw = new Brontowurst(); bw.HoldOnion(); bw.AddOnion(); Assert.Contains("Onion", bw.Ingredients); }