public void HoldJellyShouldAddToSpecial() { PrehistoricPBJ pbj = new PrehistoricPBJ(); pbj.HoldJelly(); Assert.Collection <string>(pbj.Special, item => { Assert.Equal("Hold Jelly", item); }); }
public void PrehistoricPBJShouldHaveCorrectSpecialForHoldJelly() { PrehistoricPBJ pb = new PrehistoricPBJ(); pb.HoldJelly(); Assert.Collection <string>(pb.Special, item => { Assert.Equal("Hold Jelly", item); }); }
public void AddPrehistoricPBJ(object sender, RoutedEventArgs args) { if (DataContext is Order order) { PrehistoricPBJ p = new PrehistoricPBJ(); order.Add(p); this.Entree = p; NavigationService.Navigate(new CustomizePBJ(p)); } }
public void HoldingJellyShouldNotifySpecialChange() { PrehistoricPBJ pbj = new PrehistoricPBJ(); Assert.PropertyChanged(pbj, "Special", () => { pbj.HoldJelly(); }); }
/// <summary> /// Creates the combo for the customize brontowurst combo page. /// </summary> /// <param name="sender"></param> /// <param name="args"></param> void CustomizePrehistoricPBJCombo(object sender, RoutedEventArgs args) { if (DataContext is Order order) { PrehistoricPBJ pbj = new PrehistoricPBJ(); combo = new CretaceousCombo(pbj); order.Add(combo); NavigationService.Navigate(new CustomizePrehistoricPBJ(combo)); } }
/// <summary> /// Adds the selected item to the menu and moves back to the main window /// </summary> /// <param name="sender"></param> /// <param name="args"></param> public void PrehistoricPBJSelect(object sender, RoutedEventArgs args) { if (DataContext is Order order) { Entree s = new PrehistoricPBJ(); order.Add(s); CollectionViewSource.GetDefaultView(order.Items).MoveCurrentToLast(); NavigationService.Navigate(new EntreeCustomization(s)); } }
public void HoldingPeanutButterShouldNotifySpecialChange() { PrehistoricPBJ pbj = new PrehistoricPBJ(); Assert.PropertyChanged(pbj, "Special", () => { pbj.HoldPeanutButter(); }); }
public void SpecialShouldHoldPeanutButterAndJelly() { PrehistoricPBJ pbj = new PrehistoricPBJ(); pbj.HoldPeanutButter(); pbj.HoldJelly(); Assert.Collection <string>(pbj.Special, item => { Assert.Equal("Hold Peanut Butter", item); }, item => { Assert.Equal("Hold Jelly", item); }); }
/// <summary> /// Occurs when the appropriate button is clicked /// </summary> /// <param name="sender"></param> /// <param name="args"></param> private void OnSelectPrehistoricPBJ(object sender, RoutedEventArgs args) { if (DataContext is Order order) { PrehistoricPBJ pbj = new PrehistoricPBJ(); entree = pbj; order.Items.Add(pbj); NavigationService.Navigate(new CustomisePrehistoricPBJ(pbj)); } }
public void AddPBJ(object sender, RoutedEventArgs e) { if (DataContext is Order order) { DinoDiner.Menu.Entree entree = new PrehistoricPBJ(); order.Items.Add(entree); CollectionViewSource.GetDefaultView(order.Items).MoveCurrentToLast(); this.NavigationService.Navigate(new Uri("EntreeScreen/PrehistoricPBJ.xaml", UriKind.Relative)); } }
public void ShouldListDefaultIngredients() { PrehistoricPBJ pbj = new PrehistoricPBJ(); List <string> ingredients = pbj.Ingredients; Assert.Contains <string>("Bread", ingredients); Assert.Contains <string>("Peanut Butter", ingredients); Assert.Contains <string>("Jelly", ingredients); Assert.Equal <int>(3, ingredients.Count); }
public void MultipleSpecialTest() { PrehistoricPBJ v = new PrehistoricPBJ(); v.HoldPeanutButter(); v.HoldJelly(); Assert.Contains("Hold Peanut Butter", v.Special); Assert.Contains("Hold Jelly", v.Special); string[] arr = v.Special; Assert.Equal <int>(2, arr.Length); }
public void HoldPBJShouldAddToSpecial() { PrehistoricPBJ pbj = new PrehistoricPBJ(); pbj.HoldJelly(); pbj.HoldPeanutButter(); Assert.Contains("Hold Peanut Butter", pbj.Special); Assert.Contains("Hold Jelly", pbj.Special); Assert.Equal(2, pbj.Special.Length); }
public void AllSpecialsShouldBeApplied() { PrehistoricPBJ pbj = new PrehistoricPBJ(); pbj.HoldJelly(); pbj.HoldPeanutButter(); Assert.Contains("Hold Jelly", pbj.Special); Assert.Contains("Hold Peanut Butter", pbj.Special); Assert.Equal(2, pbj.Special.Length); }
/// <summary> /// taes you to the customize page on button push /// </summary> private void OnSelectPrehistoricPBJ(object sender, RoutedEventArgs args) { if (DataContext is Order order) { PrehistoricPBJ pbj = new PrehistoricPBJ(); cc.Entree = pbj; NavigationService.Navigate(new CustomizePBJ(pbj, true, cc)); //CretaceousCombo cc = new CretaceousCombo(pbj); order.Add(cc); } }
public void HoldPeanutButterSouldAddToSpecial() { PrehistoricPBJ pbj = new PrehistoricPBJ(); pbj.HoldPeanutButter(); Assert.Collection <string>(pbj.Special, item => { Assert.Equal("Hold Peanut Butter", item); }); }
public void RemovePeanutButterShouldNotifyOfPropertyChange(string propertyName) { PrehistoricPBJ pbj = new PrehistoricPBJ(); // attach event listener to dn event handler // call addnugget Assert.PropertyChanged(pbj, propertyName, () => { pbj.HoldPeanutButter(); }); }
public PrehistoricPBJCustomization() { InitializeComponent(); if (DataContext is Order order) { if (CollectionViewSource.GetDefaultView(order.Items).CurrentItem is PrehistoricPBJ pbj) { this.pbj = pbj; } } }
private void SelectPrehistoric(object sender, RoutedEventArgs args) { PrehistoricPBJ pbj = new PrehistoricPBJ(); CretaceousCombo c = new CretaceousCombo(pbj); if (DataContext is Order order) { order.Add(c); //NavigationService.Navigate(new CustomizePrehistoricPBJ(c)); } }
public void PrehistoricPBJShouldHaveCorrectSpecial() { PrehistoricPBJ dr = new PrehistoricPBJ(); dr.HoldPeanutButter(); dr.HoldJelly(); Assert.Collection <string>(dr.Special, item => { Assert.Equal("Hold Peanut Butter", item); }, item => { Assert.Equal("Hold Jelly", item); } ); }
public void ShouldCombineSpecialInstructions() { PrehistoricPBJ p = new PrehistoricPBJ(); p.HoldJelly(); p.HoldPeanutButter(); Assert.Contains("Hold Jelly", p.Special); Assert.Contains("Hold Peanut Butter", p.Special); Assert.Equal(2, p.Special.Length); }
/// <summary> /// Navigates to Customize Combo page /// </summary> /// <param name="sender">Object sent</param> /// <param name="e">Routed Event Argument</param> private void PBSelect(object sender, RoutedEventArgs e) { PrehistoricPBJ pbj = new PrehistoricPBJ(); CretaceousCombo combo = new CretaceousCombo(pbj); if (DataContext is Order order) { order.Add(combo); NavigationService.Navigate(new CustomizeEntree(combo)); } }
public void PrehistoricPBJComboSpecialShouldChange() { PrehistoricPBJ pbj = new PrehistoricPBJ(); Triceritots t = new Triceritots(); CretaceousCombo combo = new CretaceousCombo(pbj); Water w = new Water(); combo.Side = t; combo.Drink = w; Assert.Equal("Small Triceritots", combo.Special[0]); Assert.Equal("Small Water", combo.Special[1]); }
public void ShouldHaveHoldJellyWhenHoldingJelly() { PrehistoricPBJ pbj = new PrehistoricPBJ(); pbj.HoldJelly(); Assert.Collection(pbj.Special, item => { Assert.Equal("Hold Jelly", item); } ); }
public void ShouldHaveHoldPeanutButterWhenHoldingPeanutButter() { PrehistoricPBJ pbj = new PrehistoricPBJ(); pbj.HoldPeanutButter(); Assert.Collection(pbj.Special, item => { Assert.Equal("Hold Peanut Butter", item); } ); }
/// <summary> /// Button for adding PBJ /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Add_PBJ(object sender, RoutedEventArgs e) { if (DataContext is Order order) { PrehistoricPBJ pbj = new PrehistoricPBJ(); _entree = pbj; order.Add(_entree); } // back to main page automatically NavigationService.Navigate(new PrehistoricPBJ_Customize(_entree as PrehistoricPBJ)); }
public void PrehistoricPBJSpecialsTest() { PrehistoricPBJ pbj = new PrehistoricPBJ(); Assert.Empty(pbj.Special); pbj.HoldPeanutButter(); Assert.Contains("Hold Peanut Butter", pbj.Special); pbj.HoldJelly(); Assert.Contains("Hold Jelly", pbj.Special); }
private void EntreeItemSelected(object sender, RoutedEventArgs e) { if (DataContext is Order order) { Button btn = (Button)sender; string itemName = btn.Content.ToString(); switch (itemName) { case "Brontowurst": Brontowurst bronto = new Brontowurst(); order.Add(bronto); NavigationService.Navigate(new CustomizeBronto(bronto)); break; case "Dino-Nuggets": DinoNuggets nuggets = new DinoNuggets(); order.Add(nuggets); NavigationService.Navigate(new CustomizeNugget(nuggets)); break; case "Steakosaurus Burger": SteakosaurusBurger steak = new SteakosaurusBurger(); order.Add(steak); NavigationService.Navigate(new CustomizeSteak(steak)); break; case "T-Rex King Burger": TRexKingBurger tRex = new TRexKingBurger(); order.Add(tRex); NavigationService.Navigate(new CustomizeTRex(tRex)); break; case "Prehistoric PB&J": PrehistoricPBJ pbj = new PrehistoricPBJ(); order.Add(pbj); NavigationService.Navigate(new CustomizePBJ(pbj)); break; case "Veloci-Wrap": VelociWrap veloci = new VelociWrap(); order.Add(veloci); NavigationService.Navigate(new CustomizeVeloci(veloci)); break; case "Pterodactyl Wings": order.Add(new PterodactylWings()); break; } CollectionViewSource.GetDefaultView(order.Items).MoveCurrentToLast(); } }
public void PBJPropertyTest() { PrehistoricPBJ pbj = new PrehistoricPBJ(); Assert.PropertyChanged(pbj, "Special", () => { pbj.HoldJelly(); }); Assert.PropertyChanged(pbj, "Special", () => { pbj.HoldPeanutButter(); }); }
public void HoldingIngredientsShouldNotifyOfPropertyChange(string propertyName) { PrehistoricPBJ entree = new PrehistoricPBJ(); Assert.PropertyChanged(entree, propertyName, () => { entree.HoldPeanutButter(); }); Assert.PropertyChanged(entree, propertyName, () => { entree.HoldJelly(); }); }