Exemplo n.º 1
0
        public void HoldJellyShouldAddToSpecial()
        {
            PrehistoricPBJ pbj = new PrehistoricPBJ();

            pbj.HoldJelly();
            Assert.Collection <string>(pbj.Special, item =>
            {
                Assert.Equal("Hold Jelly", item);
            });
        }
Exemplo n.º 2
0
        public void PrehistoricPBJShouldHaveCorrectSpecialForHoldJelly()
        {
            PrehistoricPBJ pb = new PrehistoricPBJ();

            pb.HoldJelly();
            Assert.Collection <string>(pb.Special, item =>
            {
                Assert.Equal("Hold Jelly", item);
            });
        }
Exemplo n.º 3
0
 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));
     }
 }
Exemplo n.º 4
0
        public void HoldingJellyShouldNotifySpecialChange()
        {
            PrehistoricPBJ pbj = new PrehistoricPBJ();

            Assert.PropertyChanged(pbj, "Special",
                                   () =>
            {
                pbj.HoldJelly();
            });
        }
Exemplo n.º 5
0
 /// <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));
     }
 }
Exemplo n.º 7
0
        public void HoldingPeanutButterShouldNotifySpecialChange()
        {
            PrehistoricPBJ pbj = new PrehistoricPBJ();

            Assert.PropertyChanged(pbj, "Special",
                                   () =>
            {
                pbj.HoldPeanutButter();
            });
        }
Exemplo n.º 8
0
        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); });
        }
Exemplo n.º 9
0
 /// <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));
     }
 }
Exemplo n.º 11
0
        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);
        }
Exemplo n.º 12
0
        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);
        }
Exemplo n.º 13
0
        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);
        }
Exemplo n.º 15
0
 /// <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);
     }
 }
Exemplo n.º 16
0
        public void HoldPeanutButterSouldAddToSpecial()
        {
            PrehistoricPBJ pbj = new PrehistoricPBJ();

            pbj.HoldPeanutButter();
            Assert.Collection <string>(pbj.Special,
                                       item =>
            {
                Assert.Equal("Hold Peanut Butter", item);
            });
        }
Exemplo n.º 17
0
        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;
         }
     }
 }
Exemplo n.º 19
0
        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));
            }
        }
Exemplo n.º 20
0
        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); }
                                       );
        }
Exemplo n.º 21
0
        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);
        }
Exemplo n.º 22
0
        /// <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));
            }
        }
Exemplo n.º 23
0
        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]);
        }
Exemplo n.º 24
0
        public void ShouldHaveHoldJellyWhenHoldingJelly()
        {
            PrehistoricPBJ pbj = new PrehistoricPBJ();

            pbj.HoldJelly();
            Assert.Collection(pbj.Special,
                              item =>
            {
                Assert.Equal("Hold Jelly", item);
            }
                              );
        }
Exemplo n.º 25
0
        public void ShouldHaveHoldPeanutButterWhenHoldingPeanutButter()
        {
            PrehistoricPBJ pbj = new PrehistoricPBJ();

            pbj.HoldPeanutButter();
            Assert.Collection(pbj.Special,
                              item =>
            {
                Assert.Equal("Hold Peanut Butter", item);
            }
                              );
        }
Exemplo n.º 26
0
        /// <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));
        }
Exemplo n.º 27
0
        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);
        }
Exemplo n.º 28
0
        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();
            }
        }
Exemplo n.º 29
0
        public void PBJPropertyTest()
        {
            PrehistoricPBJ pbj = new PrehistoricPBJ();

            Assert.PropertyChanged(pbj, "Special", () =>
            {
                pbj.HoldJelly();
            });
            Assert.PropertyChanged(pbj, "Special", () =>
            {
                pbj.HoldPeanutButter();
            });
        }
Exemplo n.º 30
0
        public void HoldingIngredientsShouldNotifyOfPropertyChange(string propertyName)
        {
            PrehistoricPBJ entree = new PrehistoricPBJ();

            Assert.PropertyChanged(entree, propertyName, () =>
            {
                entree.HoldPeanutButter();
            });
            Assert.PropertyChanged(entree, propertyName, () =>
            {
                entree.HoldJelly();
            });
        }