Exemplo n.º 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();
            });
        }
Exemplo n.º 2
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);
        }
Exemplo n.º 3
0
        public void HoldCheeseShouldNotifyofSpecialPropertyChange()
        {
            VelociWrap vw = new VelociWrap();

            vw.HoldCheese();
            Assert.PropertyChanged(vw, "Special", () =>
            {
                vw.HoldCheese();
            });
        }
Exemplo n.º 4
0
        public void SpecialShouldHoldCheese()
        {
            VelociWrap vw = new VelociWrap();

            vw.HoldCheese();
            Assert.Contains("Hold Cheese", vw.Special);
        }
Exemplo n.º 5
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);
            }



                                       );
        }
Exemplo n.º 6
0
        public void HoldingCheeseShouldAddToSpecial()
        {
            VelociWrap vw = new VelociWrap();

            vw.HoldCheese();
            Assert.Contains("Hold Cheese", vw.Special);
        }
Exemplo n.º 7
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);
                }
            }
        }
Exemplo n.º 8
0
        public void SpecialShouldHoldCheese()
        {
            VelociWrap vw = new VelociWrap();

            vw.HoldCheese();
            Assert.Collection <string>(vw.Special, item => { Assert.Equal("Hold Cheese", item); });
        }
Exemplo n.º 9
0
        public void holdCheeseNotifies()
        {
            VelociWrap vw = new VelociWrap();

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

            Assert.PropertyChanged(vw, "Ingredients", () =>
            {
                vw.HoldCheese();
            }
                                   );
        }
Exemplo n.º 10
0
        public void HoldCheeseShouldProvideCorrectSpecial()
        {
            VelociWrap vw = new VelociWrap();

            vw.HoldCheese();
            Assert.Contains("Hold Cheese", vw.Special);
        }
Exemplo n.º 11
0
        public void HoldCheeseShouldChangeSpecial()
        {
            VelociWrap vw = new VelociWrap();

            vw.HoldCheese();
            Assert.Contains <string>("Hold Parmesan Cheese", vw.Special);
        }
Exemplo n.º 12
0
        public void VelociwrapShouldHaveCorrectSpecialHoldCheese()
        {
            VelociWrap pb = new VelociWrap();

            pb.HoldCheese();
            Assert.Contains <string>("Hold Cheese", pb.Special);
        }
Exemplo n.º 13
0
        public void AddCheeseShouldAddCheese()
        {
            VelociWrap vw = new VelociWrap();

            vw.HoldCheese();
            vw.AddCheese();
            Assert.Contains("Parmesan Cheese", vw.Ingredients);
        }
Exemplo n.º 14
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());
        }
Exemplo n.º 15
0
        public void ShouldHaveHoldCheeseSpecial()
        {
            VelociWrap wrap = new VelociWrap();

            wrap.HoldCheese();
            string[] special = { "Hold Cheese" };
            Assert.Equal(wrap.Special, special);
        }