Exemplo n.º 1
0
        public void CandyMakesMunchMunchSound()
        {
            Candy  candy        = new Candy("A1", "Snickers", (decimal)1.00, "Candy");
            string actualString = candy.MakeSound();

            Assert.AreEqual("Munch Munch, Yum!", actualString, "Candy items should make munch sound.");
        }
Exemplo n.º 2
0
        public void MakeSoundMethod_Normal()
        {
            Candy candy = new Candy("Crunchie", 1.75M);

            string sound = candy.MakeSound();

            Assert.AreEqual("Munch Munch, Yum!", sound);
        }
Exemplo n.º 3
0
        public void CandyExpectedSound()
        {
            Candy candy = new Candy("Candy Bar", 1);

            string actual = candy.MakeSound();

            Assert.AreEqual("Munch Munch, Yum!", actual, "Make sound for candy");
        }
Exemplo n.º 4
0
        public void MakeSoundMethod_Exceptions()
        {
            Candy candy = new Candy("", -1.75M);

            string sound = candy.MakeSound();

            Assert.AreEqual("Munch Munch, Yum!", sound);

            candy = new Candy(null, -1.0M);

            sound = candy.MakeSound();

            Assert.AreEqual("Munch Munch, Yum!", sound);
        }
Exemplo n.º 5
0
        public void TestSound()
        {
            Chip testChip = new Chip("doritos", 1.50M);

            Assert.AreEqual("Crunch, Crunch, Yum!", testChip.MakeSound(), "Didn't make correct sound.");

            Candy testCandy = new Candy("hersheys", 2.00M);

            Assert.AreEqual("Munch, Munch, Yum!", testCandy.MakeSound(), "Didn't make correct sound.");

            Drink testDrink = new Drink("whiskey", 0.50M);

            Assert.AreEqual("Glug, Glug, Yum!", testDrink.MakeSound(), "Didn't make correct sound.");

            Gum testGum = new Gum("five", 3.00M);

            Assert.AreEqual("Chew, Chew, Yum!", testGum.MakeSound(), "Didn't make correct sound.");
        }
Exemplo n.º 6
0
        public void MakeSound()
        {
            Candy candySound = new Candy("B1", "ChocolateFudge", 1.05M);

            Assert.AreEqual("Munch Munch, Yum!", candySound.MakeSound());
        }