public void ShouldHaveCorrectSpecial() { SteakosaurusBurger s = new SteakosaurusBurger(); s.HoldBun(); Assert.Collection(s.Special, item => { Assert.Equal("Hold Bun", item); }); s.bun = true; s.HoldKetchup(); Assert.Collection(s.Special, item => { Assert.Equal("Hold Ketchup", item); }); s.ketchup = true; s.HoldMustard(); Assert.Collection(s.Special, item => { Assert.Equal("Hold Mustard", item); }); s.mustard = true; s.HoldPickle(); Assert.Collection(s.Special, item => { Assert.Equal("Hold Pickle", item); }); s.HoldBun(); s.HoldKetchup(); s.HoldMustard(); string[] specials = new string[] { "Hold Bun", "Hold Pickle", "Hold Ketchup", "Hold Mustard" }; Assert.Equal(s.Special, specials); }
public void MultipleSteakosaurusBurgerSpecialShouldChange(string ans1, string ans2, string ans3) { SteakosaurusBurger sb = new SteakosaurusBurger(); if (ans1 == "Hold Ketchup") { sb.HoldKetchup(); } if (ans1 == "Hold Whole Wheat Bun") { sb.HoldBun(); } if (ans1 == "Hold Pickle") { sb.HoldPickle(); } if (ans1 == "Hold Mustard") { sb.HoldMustard(); } if (ans2 == "Hold Ketchup") { sb.HoldKetchup(); } if (ans2 == "Hold Whole Wheat Bun") { sb.HoldBun(); } if (ans2 == "Hold Pickle") { sb.HoldPickle(); } if (ans2 == "Hold Mustard") { sb.HoldMustard(); } if (ans3 == "Hold Ketchup") { sb.HoldKetchup(); } if (ans3 == "Hold Whole Wheat Bun") { sb.HoldBun(); } if (ans3 == "Hold Pickle") { sb.HoldPickle(); } if (ans3 == "Hold Mustard") { sb.HoldMustard(); } Assert.Contains(ans1, sb.Special); Assert.Contains(ans2, sb.Special); Assert.Contains(ans3, sb.Special); }
public void HoldbunShouldNotifyofSpecialPropertyChange() { SteakosaurusBurger sb = new SteakosaurusBurger(); sb.HoldBun(); Assert.PropertyChanged(sb, "Special", () => { sb.HoldBun(); }); }
public void CheckPropertyChangedSteakosaurusBurger() { SteakosaurusBurger ft = new SteakosaurusBurger(); Assert.PropertyChanged(ft, "Price", () => ft.Price *= 2); Assert.PropertyChanged(ft, "Bun", () => ft.HoldBun()); Assert.PropertyChanged(ft, "Pickle", () => ft.HoldPickle()); Assert.PropertyChanged(ft, "Mustard", () => ft.HoldMustard()); Assert.PropertyChanged(ft, "Ketchup", () => ft.HoldKetchup()); Assert.PropertyChanged(ft, "Special", () => ft.HoldBun()); }
public void HoldingBunShouldNotifySpecialAndIngredients() { SteakosaurusBurger sb = new SteakosaurusBurger(); Assert.PropertyChanged(sb, "Special", () => { sb.HoldBun(); }); Assert.PropertyChanged(sb, "Ingredients", () => { sb.HoldBun(); }); }
public void PropertyShouldChangeSteakosaurusBurger() { SteakosaurusBurger sb = new SteakosaurusBurger(); Assert.PropertyChanged(sb, "Ingredients", () => sb.HoldBun()); Assert.PropertyChanged(sb, "Ingredients", () => sb.HoldPickle()); Assert.PropertyChanged(sb, "Ingredients", () => sb.HoldKetchup()); Assert.PropertyChanged(sb, "Ingredients", () => sb.HoldMustard()); Assert.PropertyChanged(sb, "Special", () => sb.HoldBun()); Assert.PropertyChanged(sb, "Special", () => sb.HoldPickle()); Assert.PropertyChanged(sb, "Special", () => sb.HoldKetchup()); Assert.PropertyChanged(sb, "Special", () => sb.HoldMustard()); }
/// <summary> /// Holds the bun when selected /// </summary> /// <param name="sender"></param> /// <param name="args"></param> private void SelectHoldBun(object sender, RoutedEventArgs args) { if (isCombo) { if (Combo.Entree is SteakosaurusBurger sb) { sb.HoldBun(); Combo.NotifyOfPropertyChange("Special"); } } else { sb.HoldBun(); } }
private void OnHoldBun(object sender, RoutedEventArgs args) { if (sb != null) { sb.HoldBun(); } else if (combo != null) { if (combo.Entree is SteakosaurusBurger sb) { sb.HoldBun(); combo.Entree = sb; } } }
public void SteakosaurusBurgerSpecialPropertiesShouldWorkProperly() { SteakosaurusBurger sb = new SteakosaurusBurger(); Assert.Empty(sb.Special); sb.HoldBun(); Assert.Contains <string>("Hold Bun", sb.Special); sb = new SteakosaurusBurger(); sb.HoldKetchup(); Assert.Contains <string>("Hold Ketchup", sb.Special); sb = new SteakosaurusBurger(); sb.HoldMustard(); Assert.Contains <string>("Hold Mustard", sb.Special); sb = new SteakosaurusBurger(); sb.HoldPickle(); Assert.Contains <string>("Hold Pickle", sb.Special); sb = new SteakosaurusBurger(); sb.HoldBun(); sb.HoldKetchup(); sb.HoldMustard(); sb.HoldPickle(); Assert.Contains <string>("Hold Bun", sb.Special); Assert.Contains <string>("Hold Ketchup", sb.Special); Assert.Contains <string>("Hold Mustard", sb.Special); Assert.Contains <string>("Hold Pickle", sb.Special); }
public void SpecialShouldHoldKetchupAndMustardAndBunAndPickle() { SteakosaurusBurger s = new SteakosaurusBurger(); s.HoldKetchup(); s.HoldMustard(); s.HoldBun(); s.HoldPickle(); Assert.Collection <string>(s.Special, item => { Assert.Equal("Hold Ketchup", item); }, item => { Assert.Equal("Hold Mustard", item); }, item => { Assert.Equal("Hold Bun", item); }, item => { Assert.Equal("Hold Pickle", item); }); }
public void IndividualSpecialTest() { SteakosaurusBurger bun = new SteakosaurusBurger(); bun.HoldBun(); Assert.Contains("Hold Bun", bun.Special); Assert.Single(bun.Special); SteakosaurusBurger pickle = new SteakosaurusBurger(); pickle.HoldPickle(); Assert.Contains("Hold Pickle", pickle.Special); Assert.Single(pickle.Special); SteakosaurusBurger ketchup = new SteakosaurusBurger(); ketchup.HoldKetchup(); Assert.Contains("Hold Ketchup", ketchup.Special); Assert.Single(ketchup.Special); SteakosaurusBurger mustard = new SteakosaurusBurger(); mustard.HoldMustard(); Assert.Contains("Hold Mustard", mustard.Special); Assert.Single(mustard.Special); }
public void SpecialShouldHaveHoldAllCondiments() { SteakosaurusBurger sb = new SteakosaurusBurger(); sb.HoldBun(); sb.HoldPickle(); sb.HoldKetchup(); sb.HoldMustard(); Assert.Collection <string>(sb.Special, item => { Assert.Equal("Hold Whole Wheat Bun", item); }, item => { Assert.Equal("Hold Pickle", item); }, item => { Assert.Equal("Hold Ketchup", item); }, item => { Assert.Equal("Hold Mustard", item); }); }
public void HoldBunShouldRemoveBun() { SteakosaurusBurger sb = new SteakosaurusBurger(); sb.HoldBun(); Assert.DoesNotContain <string>("Whole Wheat Bun", sb.Ingredients); }
public void SteakosaurusSpecialShouldGiveCorrectArrayForThreeSpecials() { SteakosaurusBurger sb = new SteakosaurusBurger(); sb.HoldBun(); sb.HoldKetchup(); sb.HoldMustard(); Assert.Contains <string>("Hold Bun", sb.Special); Assert.Contains <string>("Hold Ketchup", sb.Special); Assert.Contains <string>("Hold Mustard", sb.Special); sb = new SteakosaurusBurger(); sb.HoldBun(); sb.HoldKetchup(); sb.HoldPickle(); Assert.Contains <string>("Hold Bun", sb.Special); Assert.Contains <string>("Hold Ketchup", sb.Special); Assert.Contains <string>("Hold Pickle", sb.Special); sb = new SteakosaurusBurger(); sb.HoldBun(); sb.HoldPickle(); sb.HoldMustard(); Assert.Contains <string>("Hold Bun", sb.Special); Assert.Contains <string>("Hold Pickle", sb.Special); Assert.Contains <string>("Hold Mustard", sb.Special); sb = new SteakosaurusBurger(); sb.HoldPickle(); sb.HoldKetchup(); sb.HoldMustard(); Assert.Contains <string>("Hold Pickle", sb.Special); Assert.Contains <string>("Hold Ketchup", sb.Special); Assert.Contains <string>("Hold Mustard", sb.Special); }
public void SteakosaurusBugerNotifyPropertyChanged() { SteakosaurusBurger sb = new SteakosaurusBurger(); Assert.PropertyChanged(sb, "Price", () => { sb.Price = 10; }); Assert.PropertyChanged(sb, "Calories", () => { sb.Calories = 10; }); System.Action[] actions = { () => { sb.HoldBun(); }, () => { sb.HoldPickle(); }, () => { sb.HoldKetchup(); }, () => { sb.HoldMustard(); }, }; string[] properties = { "Special", "Ingredients" }; foreach (System.Action action in actions) { foreach (string property in properties) { Assert.PropertyChanged(sb, property, action); } } }
public void SpecialShouldHoldAll() { SteakosaurusBurger bw = new SteakosaurusBurger(); bw.HoldBun(); bw.HoldKetchup(); bw.HoldPickle(); bw.HoldMustard(); Assert.Collection <string>(bw.Special, item => { Assert.Equal("Hold Whole Wheat Bun", item); }, item => { Assert.Equal("Hold Pickle", item); }, item => { Assert.Equal("Hold Ketchup", item); }, item => { Assert.Equal("Hold Mustard", item); } ); }
public void HoldBunShouldChangeSpecialBun() { SteakosaurusBurger sb = new SteakosaurusBurger(); sb.HoldBun(); Assert.Contains <string>("Hold Whole Wheat Bun", sb.Special); }
public void HoldAllShouldAddToSpecial() { SteakosaurusBurger sb = new SteakosaurusBurger(); sb.HoldBun(); sb.HoldPickle(); sb.HoldKetchup(); sb.HoldMustard(); Assert.Collection <string>(sb.Special, item => { Assert.Equal("Hold Whole Wheat Bun", item); }, item => { Assert.Equal("Hold Pickle", item); }, item => { Assert.Equal("Hold Ketchup", item); }, item => { Assert.Equal("Hold Mustard", item); }); //Have to have in correct order to be able to pass test }
public void ShouldHaveHoldBunAndHoldPickleAndHoldMustardAndHoldKetchupWhenHoldingBunAndPickleAndMustardAndKetchup() { SteakosaurusBurger sb = new SteakosaurusBurger(); sb.HoldBun(); sb.HoldPickle(); sb.HoldMustard(); sb.HoldKetchup(); Assert.Collection(sb.Special, item => { Assert.Equal("Hold Bun", item); }, item => { Assert.Equal("Hold Pickle", item); }, item => { Assert.Equal("Hold Ketchup", item); }, item => { Assert.Equal("Hold Mustard", item); } ); }
public void SteakosaurusBurgerPropertyChangesShouldWorkProperly() { SteakosaurusBurger sb = new SteakosaurusBurger(); Assert.PropertyChanged(sb, "Special", () => sb.HoldBun()); Assert.PropertyChanged(sb, "Special", () => sb.HoldKetchup()); Assert.PropertyChanged(sb, "Special", () => sb.HoldMustard()); Assert.PropertyChanged(sb, "Special", () => sb.HoldPickle()); }
public void ShouldHaveCorrectSpecialAfterHoldingBun() { SteakosaurusBurger sb = new SteakosaurusBurger(); sb.HoldBun(); Assert.Contains <string>("Hold Bun", sb.Special); }
public void HoldBunAddsHoldBunToSpecial() { SteakosaurusBurger entree = new SteakosaurusBurger(); entree.HoldBun(); Assert.Equal("Hold Bun", entree.Special[0]); }
public void HoldingBunShouldAddToSpecial() { SteakosaurusBurger sb = new SteakosaurusBurger(); sb.HoldBun(); Assert.Contains("Hold Bun", sb.Special); }
public void ShouldHaveCorrectSpecialInstructions() { SteakosaurusBurger s = new SteakosaurusBurger(); Triceritots t = new Triceritots(); Sodasaurus ss = new Sodasaurus(); s.HoldBun(); s.HoldKetchup(); t.MakeMedium(); ss.HoldIce(); CretaceousCombo c = new CretaceousCombo(s); c.Side = t; c.Drink = ss; Assert.Collection <string>(c.Special, item => { Assert.Equal("Hold Bun", item); }, item => { Assert.Equal("Hold Ketchup", item); }, item => { Assert.Equal("Medium Triceritots", item); }, item => { Assert.Equal("Small Cola Sodasaurus", item); }, item => { Assert.Equal("Hold Ice", item); }); }
private void BunClick(object sender, RoutedEventArgs arsg) { if (DataContext is Order order) { sb.HoldBun(); } }
public void HoldBunKetchupMusardMusardShoukdAddToSpecial() { SteakosaurusBurger sb = new SteakosaurusBurger(); sb.HoldBun(); sb.HoldKetchup(); sb.HoldPickle(); sb.HoldMustard(); Assert.Collection <string>(sb.Special, item => { Assert.Equal("Hold Whole Wheat Bun", item); }, item => { Assert.Equal("Hold Pickle", item); }, item => { Assert.Equal("Hold Ketchup", item); }, item => { Assert.Equal("Hold Mustard", item); }); }
public void HoldAllShouldAddAllToSpecial() { SteakosaurusBurger sb = new SteakosaurusBurger(); sb.HoldBun(); sb.HoldPickle(); sb.HoldKetchup(); sb.HoldMustard(); Assert.Collection <string>(sb.Special, item => { Assert.Equal("Hold Bun", item); }, item => { Assert.Equal("Hold Pickles", item); }, item => { Assert.Equal("Hold Ketchup", item); }, item => { Assert.Equal("Hold Mustard", item); }); }
public void holdBunNotifies() { SteakosaurusBurger sb = new SteakosaurusBurger(); Assert.PropertyChanged(sb, "Special", () => { sb.HoldBun(); } ); Assert.PropertyChanged(sb, "Ingredients", () => { sb.HoldBun(); } ); }
public void SpecialShouldBeCorrectAfterHoldingManyThings() { SteakosaurusBurger sb = new SteakosaurusBurger(); sb.HoldPickle(); sb.HoldKetchup(); sb.HoldMustard(); sb.HoldBun(); Assert.Collection <string>(sb.Special, item => { Assert.Equal("Hold Pickle", item); }, item => { Assert.Equal("Hold Mustard", item); }, item => { Assert.Equal("Hold Ketchup", item); }, item => { Assert.Equal("Hold Whole-Wheat Bun", item); }); }
public void SpecialShouldHaveHoldBun() { SteakosaurusBurger sb = new SteakosaurusBurger(); sb.HoldBun(); Assert.Collection <string>(sb.Special, item => { Assert.Equal("Hold Whole Wheat Bun", item); }); }