Exemplo n.º 1
0
        public void WakeUpTest()
        {
            var animal = new Giraffe("test", 1);

            animal.NightNight();
            animal.WakeUp();

            Assert.IsFalse(animal.IsSleeping);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        public void WakeUpInvalidTest()
        {
            var animal = new Giraffe("test", 1);

            Assert.ThrowsException <IsNotSleepingException>(() => animal.WakeUp());
        }