public void WakeUpTest() { var animal = new Giraffe("test", 1); animal.NightNight(); animal.WakeUp(); Assert.IsFalse(animal.IsSleeping); }
public void Voice_WhenAllAnimalsIsSleeping_ReturnsAllVoices() { zoo.ChangeDayMode(DayMode.Night); giraffe.IsSleeping = true; bear.IsSleeping = true; StringBuilder builder = new StringBuilder(); builder.Append(giraffe.WakeUp()).AppendLine(giraffe.Voice()).AppendLine().Append(bear.WakeUp()).AppendLine(bear.Voice()).AppendLine(); giraffe.IsSleeping = true; bear.IsSleeping = true; var result = zoo.Voice(); Assert.Equal(builder.ToString(), result); }
public void WakeUpInvalidTest() { var animal = new Giraffe("test", 1); Assert.ThrowsException <IsNotSleepingException>(() => animal.WakeUp()); }