public void CheckCatCanGoToSleep() { ICat c = new DomesticCat(); c.GoToSleep(); Assert.True(c.IsAsleep); }
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); }
public void CheckCatIsAwake() { ICat c = new DomesticCat(); Assert.False(c.IsAsleep); }
public void CheckFeedCat() { ICat c = new DomesticCat(); Assert.Equal("Purrrrrrr", c.Eat); }
public void CheckCatHeight() { ICat c = new DomesticCat(); Assert.Equal(23, c.AverageHeight); }
public void CheckCatSetting() { ICat c = new DomesticCat(); Assert.Equal("domestic", c.Setting); }