Example #1
0
        public void HoldingShouldNotifyOfSpecialAndIngredientsPropertyChanged()
        {
            VelociWrap vw = new VelociWrap();

            Assert.PropertyChanged(vw, "Special", () =>
            {
                vw.HoldDressing();
            });
            Assert.PropertyChanged(vw, "Ingredients", () =>
            {
                vw.HoldDressing();
            });
            Assert.PropertyChanged(vw, "Special", () =>
            {
                vw.HoldLettuce();
            });
            Assert.PropertyChanged(vw, "Ingredients", () =>
            {
                vw.HoldLettuce();
            });
            Assert.PropertyChanged(vw, "Special", () =>
            {
                vw.HoldCheese();
            });
            Assert.PropertyChanged(vw, "Ingredients", () =>
            {
                vw.HoldCheese();
            });
        }
Example #2
0
        public void HoldLettuceShouldNotifyofSpecialPropertyChange()
        {
            VelociWrap vw = new VelociWrap();

            vw.HoldLettuce();
            Assert.PropertyChanged(vw, "Special", () =>
            {
                vw.HoldLettuce();
            });
        }
Example #3
0
        public void PropertyShouldChangeVelociWrap()
        {
            VelociWrap vw = new VelociWrap();

            Assert.PropertyChanged(vw, "Ingredients", () => vw.HoldDressing());
            Assert.PropertyChanged(vw, "Ingredients", () => vw.HoldLettuce());
            Assert.PropertyChanged(vw, "Ingredients", () => vw.HoldCheese());
            Assert.PropertyChanged(vw, "Special", () => vw.HoldDressing());
            Assert.PropertyChanged(vw, "Special", () => vw.HoldLettuce());
            Assert.PropertyChanged(vw, "Special", () => vw.HoldCheese());
        }
Example #4
0
        public void HoldLettucehouldNotifySpecialAndIngredientsChange()
        {
            VelociWrap vw = new VelociWrap();

            Assert.PropertyChanged(vw, "Special", () =>
            {
                vw.HoldLettuce();
            });
            Assert.PropertyChanged(vw, "Ingredients", () =>
            {
                vw.HoldLettuce();
            });
        }
 private void OnHoldLettuce(object sender, RoutedEventArgs args)
 {
     if (vw != null)
     {
         vw.HoldLettuce();
     }
     else if (combo != null)
     {
         if (combo.Entree is VelociWrap vw)
         {
             vw.HoldLettuce();
             combo.Entree = vw;
         }
     }
 }
Example #6
0
 /// <summary>
 /// Holds lettuce when selected
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="args"></param>
 private void SelectHoldLettuce(object sender, RoutedEventArgs args)
 {
     if (isCombo)
     {
         if (Combo.Entree is VelociWrap vw)
         {
             vw.HoldLettuce();
             Combo.NotifyOfPropertyChange("Special");
         }
     }
     else
     {
         vw.HoldLettuce();
     }
 }
Example #7
0
        public void SpecialShouldHoldAll()
        {
            VelociWrap pbj = new VelociWrap();

            pbj.HoldCheese();
            pbj.HoldDressing();
            pbj.HoldLettuce();


            Assert.Collection <string>(pbj.Special,
                                       item =>
            {
                Assert.Equal("Hold Romaine Lettuce", item);
            },
                                       item =>
            {
                Assert.Equal("Hold Ceasar Dressing", item);
            },
                                       item =>
            {
                Assert.Equal("Hold Parmesan Cheese", item);
            }



                                       );
        }
Example #8
0
        public void HoldingLettuceShouldAddToSpecial()
        {
            VelociWrap vw = new VelociWrap();

            vw.HoldLettuce();
            Assert.Contains("Hold Lettuce", vw.Special);
        }
Example #9
0
        public void VelociWrapNotifyPropertyChanged()
        {
            VelociWrap vw = new VelociWrap();

            Assert.PropertyChanged(vw, "Price", () =>
            {
                vw.Price = 10;
            });
            Assert.PropertyChanged(vw, "Calories", () =>
            {
                vw.Calories = 10;
            });

            System.Action[] actions =
            {
                () => { vw.HoldLettuce();  },
                () => { vw.HoldDressing(); },
                () => { vw.HoldCheese();   }
            };
            string[] properties = { "Special", "Ingredients" };

            foreach (System.Action action in actions)
            {
                foreach (string property in properties)
                {
                    Assert.PropertyChanged(vw, property, action);
                }
            }
        }
Example #10
0
        public void ShouldHaveCorrectSpecials()
        {
            VelociWrap v = new VelociWrap();

            v.HoldCheese();
            Assert.Collection(v.Special, item =>
            {
                Assert.Equal("Hold Cheese", item);
            });
            v.cheese = true;
            v.HoldDressing();
            Assert.Collection(v.Special, item =>
            {
                Assert.Equal("Hold Dressing", item);
            });
            v.dressing = true;
            v.HoldLettuce();
            Assert.Collection(v.Special, item =>
            {
                Assert.Equal("Hold Lettuce", item);
            });
            v.HoldCheese();
            v.HoldDressing();
            string[] specials = new string[] { "Hold Dressing", "Hold Lettuce", "Hold Cheese" };
            Assert.Equal(v.Special, specials);
        }
Example #11
0
        public void holdLettuceNotifies()
        {
            VelociWrap vw = new VelociWrap();

            Assert.PropertyChanged(vw, "Special", () =>
            {
                vw.HoldLettuce();
            }
                                   );

            Assert.PropertyChanged(vw, "Ingredients", () =>
            {
                vw.HoldLettuce();
            }
                                   );
        }
Example #12
0
        public void SpecialShouldHoldLettuce()
        {
            VelociWrap vw = new VelociWrap();

            vw.HoldLettuce();
            Assert.Collection <string>(vw.Special, item => { Assert.Equal("Hold Lettuce", item); });
        }
        public void HoldLettuceShouldProvideCorrectSpecial()
        {
            VelociWrap vw = new VelociWrap();

            vw.HoldLettuce();
            Assert.Contains("Hold Lettuce", vw.Special);
        }
Example #14
0
        public void HoldLettuceShouldChangeSpecial()
        {
            VelociWrap vw = new VelociWrap();

            vw.HoldLettuce();
            Assert.Contains <string>("Hold Romaine Lettuce", vw.Special);
        }
Example #15
0
        public void SpecialShouldHoldLettuce()
        {
            VelociWrap vw = new VelociWrap();

            vw.HoldLettuce();
            Assert.Contains("Hold Lettuce", vw.Special);
        }
Example #16
0
        public void HoldLettuceAddsHoldLettuceToSpecial()
        {
            VelociWrap entree = new VelociWrap();

            entree.HoldLettuce();
            Assert.Equal("Hold Lettuce", entree.Special[0]);
        }
Example #17
0
        public void VelociwrapShouldHaveCorrectSpecialHoldLettuce()
        {
            VelociWrap pb = new VelociWrap();

            pb.HoldLettuce();
            Assert.Contains <string>("Hold Lettuce", pb.Special);
        }
Example #18
0
        public void HoldAllSouldAddToSpecial()
        {
            VelociWrap vw = new VelociWrap();

            vw.HoldCheese();
            vw.HoldLettuce();
            vw.HoldDressing();


            Assert.Collection <string>(vw.Special,

                                       item =>
            {
                Assert.Equal("Hold Romaine Lettuce", item);
            },

                                       item =>
            {
                Assert.Equal("Hold Ceasar Dressing", item);
            },
                                       item =>
            {
                Assert.Equal("Hold Parmesan Cheese", item);
            });
        }
Example #19
0
        public void HoldLettuceShouldRemoveLettuce()
        {
            VelociWrap vw = new VelociWrap();

            vw.HoldLettuce();
            Assert.DoesNotContain <string>("Lettuce", vw.Ingredients);
        }
Example #20
0
        public void SpecialShouldBeCorrectAfterHoldingManyThings()
        {
            VelociWrap vw = new VelociWrap();

            vw.HoldLettuce();
            vw.HoldDressing();
            vw.HoldTortilla();
            vw.HoldCheese();
            Assert.Collection <string>(vw.Special, item =>
            {
                Assert.Equal("Hold Caesar Dressing", item);
            },
                                       item =>
            {
                Assert.Equal("Hold Romaine Lettuce", item);
            },
                                       item =>
            {
                Assert.Equal("Hold Parmesan Cheese", item);
            },
                                       item =>
            {
                Assert.Equal("Hold Flour Tortilla", item);
            });
        }
Example #21
0
        public void ShouldHaveCorrectSpecialAfterHoldingLettuce()
        {
            VelociWrap vw = new VelociWrap();

            vw.HoldLettuce();
            Assert.Contains <string>("Hold Lettuce", vw.Special);
        }
Example #22
0
        public void VelociWrapSpecialPropertiesShouldWorkProperly()
        {
            VelociWrap vw = new VelociWrap();

            Assert.Empty(vw.Special);

            vw.HoldDressing();
            Assert.Contains <string>("Hold Dressing", vw.Special);

            vw = new VelociWrap();
            vw.HoldLettuce();
            Assert.Contains <string>("Hold Lettuce", vw.Special);

            vw = new VelociWrap();
            vw.HoldCheese();
            Assert.Contains <string>("Hold Cheese", vw.Special);

            vw = new VelociWrap();
            vw.HoldDressing();
            vw.HoldLettuce();
            vw.HoldCheese();
            Assert.Contains <string>("Hold Dressing", vw.Special);
            Assert.Contains <string>("Hold Lettuce", vw.Special);
            Assert.Contains <string>("Hold Cheese", vw.Special);
        }
Example #23
0
        public void ShouldHaveHoldLettuceSpecial()
        {
            VelociWrap wrap = new VelociWrap();

            wrap.HoldLettuce();
            string[] special = { "Hold Lettuce" };
            Assert.Equal(wrap.Special, special);
        }
Example #24
0
        public void HoldingItemsShouldNotifyOfPropertyChange(string s)
        {
            VelociWrap dn = new VelociWrap();

            Assert.PropertyChanged(dn, s, () => { dn.HoldCheese(); });
            Assert.PropertyChanged(dn, s, () => { dn.HoldDressing(); });
            Assert.PropertyChanged(dn, s, () => { dn.HoldLettuce(); });
        }
Example #25
0
        public void HoldingShouldNotifySpecialChange()
        {
            VelociWrap vw = new VelociWrap();

            Assert.PropertyChanged(vw, "Special", () => vw.HoldLettuce());
            Assert.PropertyChanged(vw, "Special", () => vw.HoldDressing());
            Assert.PropertyChanged(vw, "Special", () => vw.HoldCheese());
        }
Example #26
0
        public void AddLettuceShouldAddLettuce()
        {
            VelociWrap vw = new VelociWrap();

            vw.HoldLettuce();
            vw.AddLettuce();
            Assert.Contains("Romaine Lettuce", vw.Ingredients);
        }
        public void VelociWrapPropertyChanges()
        {
            VelociWrap vw = new VelociWrap();

            Assert.PropertyChanged(vw, "Special", () => vw.HoldCheese());
            Assert.PropertyChanged(vw, "Special", () => vw.HoldDressing());
            Assert.PropertyChanged(vw, "Special", () => vw.HoldLettuce());
        }
Example #28
0
        public void ShouldHaveCorrectSpecialHoldLettuce()
        {
            VelociWrap vw = new VelociWrap();

            vw.HoldLettuce();
            Assert.Contains("Hold Lettuce", vw.Special);
            Assert.Single(vw.Special);
        }
 public void OnHoldLettuce(object sender, RoutedEventArgs args)
 {
     wrap.HoldLettuce();
     if (combo != null)
     {
         combo.Entree = wrap;
     }
 }
Example #30
0
        public void CheckAllNotifyPropertyChanges(string propertyName)
        {
            VelociWrap vw = new VelociWrap();

            Assert.PropertyChanged(vw, propertyName, () => vw.HoldCheese());
            Assert.PropertyChanged(vw, propertyName, () => vw.HoldLettuce());
            Assert.PropertyChanged(vw, propertyName, () => vw.HoldDressing());
        }