示例#1
0
        public void CorrectSpecialHoldJelly()
        {
            PrehistoricPBJ pbj = new PrehistoricPBJ();

            pbj.HoldJelly();
            Assert.Contains("Hold Jelly", pbj.Special);
        }
        public void HoldingItemsShouldNotifyOfPropertyChange(string s)
        {
            PrehistoricPBJ dn = new PrehistoricPBJ();

            Assert.PropertyChanged(dn, s, () => { dn.HoldJelly(); });
            Assert.PropertyChanged(dn, s, () => { dn.HoldPeanutButter(); });
        }
示例#3
0
        public void holdJellyNotifies()
        {
            PrehistoricPBJ pbj = new PrehistoricPBJ();

            Assert.PropertyChanged(pbj, "Special", () =>
            {
                pbj.HoldJelly();
            }
                                   );

            Assert.PropertyChanged(pbj, "Ingredients", () =>
            {
                pbj.HoldJelly();
            }
                                   );
        }
        public void PrehistoricPBJNotifyPropertyChanged()
        {
            PrehistoricPBJ pbj = new PrehistoricPBJ();

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

            System.Action[] actions =
            {
                () => { pbj.HoldPeanutButter(); },
                () => { pbj.HoldJelly();        },
            };
            string[] properties = { "Special", "Ingredients" };

            foreach (System.Action action in actions)
            {
                foreach (string property in properties)
                {
                    Assert.PropertyChanged(pbj, property, action);
                }
            }
        }
示例#5
0
        public void HoldJellyShouldRemoveJelly()
        {
            PrehistoricPBJ pbj = new PrehistoricPBJ();

            pbj.HoldJelly();
            Assert.DoesNotContain <string>("Jelly", pbj.Ingredients);
        }
        public void PrehistoricPBJShouldNotify()
        {
            PrehistoricPBJ p = new PrehistoricPBJ();

            Assert.PropertyChanged(p, "Special", () => p.HoldJelly());

            Assert.PropertyChanged(p, "Special", () => p.HoldPeanutButter());
        }
示例#7
0
        public void ShouldHaveCorrectSpecialHoldJelly()
        {
            PrehistoricPBJ pbj = new PrehistoricPBJ();

            pbj.HoldJelly();
            Assert.Contains("Hold Jelly", pbj.Special);
            Assert.Single(pbj.Special);
        }
        public void HoldJellyShouldNotifyOfSpecialChanged()
        {
            PrehistoricPBJ pbj = new PrehistoricPBJ();

            Assert.PropertyChanged(pbj, "Special", () => {
                pbj.HoldJelly();
            });
        }
示例#9
0
        public void ShouldHaveHoldJellySpecial()
        {
            PrehistoricPBJ pbj = new PrehistoricPBJ();

            pbj.HoldJelly();
            string[] special = { "Hold Jelly" };
            Assert.Equal(pbj.Special, special);
        }
 private void OnHoldJelly(object sender, RoutedEventArgs args)
 {
     pbj.HoldJelly();
     if (combo != null)
     {
         combo.Entree = pbj;
     }
 }
示例#11
0
        public void SpecialShouldHoldJellyAndPeanutButter()
        {
            PrehistoricPBJ pbj = new PrehistoricPBJ();

            pbj.HoldJelly();
            pbj.HoldPeanutButter();
            Assert.Collection <string>(pbj.Special, item => { Assert.Equal("Hold Peanut Butter", item); }, item => { Assert.Equal("Hold Jelly", item); });
        }
示例#12
0
        public void AddJellyShouldAddJelly()
        {
            PrehistoricPBJ pbj = new PrehistoricPBJ();

            pbj.HoldJelly();
            pbj.AddJelly();
            Assert.Contains("Jelly", pbj.Ingredients);
        }
示例#13
0
        public void HoldingJellyShouldNotifyIngredientChange()
        {
            PrehistoricPBJ pbj = new PrehistoricPBJ();

            Assert.PropertyChanged(pbj, "Ingredients", () =>
            {
                pbj.HoldJelly();
            });
        }
示例#14
0
        public void ShouldHaveAllSpecials()
        {
            PrehistoricPBJ pbj = new PrehistoricPBJ();

            pbj.HoldPeanutButter();
            pbj.HoldJelly();
            string[] special = { "Hold Peanut Butter", "Hold Jelly" };
            Assert.Equal(pbj.Special, special);
        }
示例#15
0
        public void AddAllSpecialsToSpecial()
        {
            PrehistoricPBJ entree = new PrehistoricPBJ();

            entree.HoldPeanutButter();
            entree.HoldJelly();
            Assert.Equal("Hold Peanut Butter", entree.Special[0]);
            Assert.Equal("Hold Jelly", entree.Special[1]);
        }
示例#16
0
        public void ShouldHaveCorrectSpecialAfterHoldingPeanutButterAndHoldingJelly()
        {
            PrehistoricPBJ pbj = new PrehistoricPBJ();

            pbj.HoldPeanutButter();
            pbj.HoldJelly();
            Assert.Contains <string>("Hold Peanut Butter", pbj.Special);
            Assert.Contains <string>("Hold Jelly", pbj.Special);
        }
        public void PBnJAllHolds()
        {
            PrehistoricPBJ pbj = new PrehistoricPBJ();

            pbj.HoldJelly();
            Assert.Contains("Hold Jelly", pbj.Special);
            pbj.HoldPeanutButter();
            Assert.Contains("Hold Peanut Butter", pbj.Special);
        }
示例#18
0
        public void HoldingJellyShouldNotifySpecialChange()
        {
            PrehistoricPBJ p = new PrehistoricPBJ();

            Assert.PropertyChanged(p, "Special", () =>
            {
                p.HoldJelly();
            });
        }
示例#19
0
        public void PrehistoricPBJShouldHaveCorrectSpecialForHoldAll()
        {
            PrehistoricPBJ pb = new PrehistoricPBJ();

            pb.HoldJelly();
            pb.HoldPeanutButter();
            Assert.Contains <string>("Hold Jelly", pb.Special);
            Assert.Contains <string>("Hold Peanut Butter", pb.Special);
        }
示例#20
0
        public void HoldJellyrShouldAddToSpecial()
        {
            PrehistoricPBJ pbj = new PrehistoricPBJ();

            pbj.HoldJelly();

            Assert.Contains("Hold Jelly", pbj.Special);
            Assert.Single(pbj.Special);
        }
示例#21
0
        public void HoldPeanutButterAndJellyProvidesCorrectSpecial()
        {
            PrehistoricPBJ pbj = new PrehistoricPBJ();

            pbj.HoldPeanutButter();
            pbj.HoldJelly();
            Assert.Contains("Hold Peanut Butter", pbj.Special);
            Assert.Contains("Hold Jelly", pbj.Special);
        }
示例#22
0
        public void HoldJellyPeanutButterShouldChangeSpecial()
        {
            PrehistoricPBJ pbj = new PrehistoricPBJ();

            pbj.HoldJelly();
            pbj.HoldPeanutButter();
            Assert.Contains <string>("Hold Jelly", pbj.Special);
            Assert.Contains <string>("Hold Peanut Butter", pbj.Special);
        }
示例#23
0
        public void AddingNuggetsShouldNotifyOfPropertyChange(string propertyName)
        {
            PrehistoricPBJ pbj = new PrehistoricPBJ();

            Assert.PropertyChanged(pbj, propertyName, () =>
            {
                pbj.HoldJelly();
            });
        }
示例#24
0
        public void ShouldHaveAllSpecial()
        {
            PrehistoricPBJ pbj = new PrehistoricPBJ();

            pbj.HoldPeanutButter();
            pbj.HoldJelly();
            Assert.Contains("Hold Peanut Butter", pbj.Special);
            Assert.Contains("Hold Jelly", pbj.Special);
        }
示例#25
0
        public void BothPrehistoricPBJSpecialShouldChange()
        {
            PrehistoricPBJ pbj = new PrehistoricPBJ();

            pbj.HoldJelly();
            pbj.HoldPeanutButter();
            Assert.Contains("Hold Peanut Butter", pbj.Special);
            Assert.Contains("Hold Jelly", pbj.Special);
        }
示例#26
0
        public void HoldJellyShouldAddToSpecial()
        {
            PrehistoricPBJ pbj = new PrehistoricPBJ();

            pbj.HoldJelly();
            Assert.Collection <string>(pbj.Special, item =>
            {
                Assert.Equal("Hold Jelly", item);
            });
        }
示例#27
0
        public void ShouldHaveCorrectSpecialForHoldJelly()
        {
            PrehistoricPBJ pbj = new PrehistoricPBJ();

            pbj.HoldJelly();
            Assert.Collection <string>(pbj.Special, item =>
            {
                Assert.Equal("Hold Jelly", item);
            });
        }
        public void NotifyOfPropertyChanged()
        {
            PrehistoricPBJ p = new PrehistoricPBJ();

            Assert.PropertyChanged(p, "Special", () =>
            {
                p.HoldJelly();
                p.HoldPeanutButter();
            });
        }
        public void ShouldHaveCorrectSpecials()
        {
            PrehistoricPBJ p = new PrehistoricPBJ();

            p.HoldJelly();
            Assert.Collection(p.Special, item =>
            {
                Assert.Equal("Hold Jelly", item);
            });
            p.jelly = true;
            p.HoldPeanutButter();
            Assert.Collection(p.Special, item =>
            {
                Assert.Equal("Hold Peanut Butter", item);
            });
            p.HoldJelly();
            string[] specials = new string[] { "Hold Peanut Butter", "Hold Jelly" };
            Assert.Equal(p.Special, specials);
        }
示例#30
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);
        }