public void Create_SuppliedName_ShouldSetTheNameProperty() { // Arrange const string name = "Dawg"; // Act var dog = new Dog(name); // Assert Assert.AreEqual(name, dog.Name); }
public void Create_ShouldBeHungry() { // Arrange const string name = "dawg"; // Act var dog = new Dog(name); // Assert Assert.IsTrue(dog.IsHungry); }
public void Eat_SuppliedFishFood_ShouldStillBeHungry() { // Arrange var dog = new Dog("dawg"); var fishFood = new FishFood(); // Act dog.Feed(fishFood); // Assert Assert.IsTrue(dog.IsHungry); }
public void Eat_SuppliedDogFood_ShouldNotBeHungry() { // Arrange var dog = new Dog("dawg"); var dogFood = new DogFood(); // Act dog.Feed(dogFood); // Assert Assert.IsFalse(dog.IsHungry); }
public void Move_DogNotHungry_ShouldMakeDogHungry() { // Arrange var dog = new Dog("Lady Dawg"); dog.Feed(new DogFood()); // Act dog.Move(); // Assert Assert.True(dog.IsHungry); }
public void Speak_ShouldReturnWhatDogsSay() { // Arrange var dog = new Dog("Sir Dawg"); // Act var speach = dog.Speak(); // Assert Assert.AreEqual("Woof woof", speach); }
public void Move_IsHungry_ShouldThrowArgumentException() { // Arrange var dog = new Dog("Lord Dawg"); // Act var exception = Assert.Throws<ArgumentException>(() => dog.Move()); // Assert StringAssert.Contains("Cannot move while hungry", exception.Message); }