public void Create_SuppliedName_ShouldSetTheNameProperty() { // Arrange const string name = "Mr Meow"; // Act var cat = new Cat(name); // Assert Assert.AreEqual(name, cat.Name); }
public void Create_ShouldNotBeHungry() { // Arrange const string name = "Mr Meow"; // Act var cat = new Cat(name); // Assert Assert.IsFalse(cat.IsHungry); }
public void Eat_SuppliedFishFood_ShouldthrowArgumentException() { // Arrange var cat = new Cat("Mr Meow"); var fishFood = new FishFood(); // Act var exception = Assert.Throws<ArgumentException>(() => cat.Feed(fishFood)); // Assert StringAssert.Contains("Cats can only eat CatFood", exception.Message); }
public void Eat_SuppliedCatFood_ShouldNotBeHungry() { // Arrange var cat = new Cat("Mr Meow"); var catFood = new CatFood(); // Act cat.Feed(catFood); // Assert Assert.IsFalse(cat.IsHungry); }