Exemple #1
0
        public void CheckCatCanGoToSleep()
        {
            ICat c = new DomesticCat();

            c.GoToSleep();
            Assert.True(c.IsAsleep);
        }
Exemple #2
0
        public void CheckCatCanWakeUp()
        {
            ICat c = new DomesticCat();

            c.GoToSleep();
            c.WakeUp();
            Assert.False(c.IsAsleep);
        }
        public void CheckCatAfterEating()
        {
            ICat c = new DomesticCat();

            // fetch a random after=eating string and ensure that the
            // result matches a least one of the two valid domestic cat reactions.

            string afterEat = c.AfterEat();

            Assert.True(afterEat == "It will do I suppose" || afterEat == "Purrrrrrr");
        }
        public void CheckFeedRandomCat()
        {
            ICat c         = new DomesticCat();
            bool hasPurred = false;
            bool hasSpoken = false;

            for (int i = 0; i < 20; i++)
            {
                string outburst = c.Eat;
                hasPurred = hasPurred | (outburst == "Purrrrrrr");
                hasSpoken = hasSpoken | (outburst == "It will do I suppose");
                if (hasPurred & hasSpoken)
                {
                    break;
                }
            }
            Assert.True(hasPurred & hasSpoken);
        }
Exemple #5
0
        public void CheckCatIsAwake()
        {
            ICat c = new DomesticCat();

            Assert.False(c.IsAsleep);
        }
Exemple #6
0
        public void CheckFeedCat()
        {
            ICat c = new DomesticCat();

            Assert.Equal("Purrrrrrr", c.Eat);
        }
Exemple #7
0
        public void CheckCatHeight()
        {
            ICat c = new DomesticCat();

            Assert.Equal(23, c.AverageHeight);
        }
Exemple #8
0
        public void CheckCatSetting()
        {
            ICat c = new DomesticCat();

            Assert.Equal("domestic", c.Setting);
        }