Exemplo n.º 1
0
        public void FullStickFigureTest()
        {
            HangingMan hangingMan = new HangingMan();

            string[] deadStickFigure = { "|--| ",
                                         "|  O ",
                                         "| /|\\",
                                         "| /\\ " };

            hangingMan.SubtractLife(); // HEAD
            hangingMan.SubtractLife(); // TORSO
            hangingMan.SubtractLife(); // RIGHT ARM
            hangingMan.SubtractLife(); // LEFT ARM
            hangingMan.SubtractLife(); // RIGHT LEG
            hangingMan.SubtractLife(); // LEFT LEG

            Assert.AreEqual(deadStickFigure, hangingMan.GetStickFigure());
        }
Exemplo n.º 2
0
        public void ResetStickFigureTest()
        {
            HangingMan hangingMan = new HangingMan();

            string[] initialStickFigure = hangingMan.GetStickFigure();

            hangingMan.SubtractLife(); // HEAD
            hangingMan.SubtractLife(); // TORSO
            hangingMan.SubtractLife(); // RIGHT ARM
            hangingMan.SubtractLife(); // LEFT ARM
            hangingMan.SubtractLife(); // RIGHT LEG
            hangingMan.SubtractLife(); // LEFT LEG

            string[] deadStickFigure = hangingMan.GetStickFigure();

            hangingMan.ResetStickFigure();
            Assert.AreNotEqual(deadStickFigure, hangingMan.GetStickFigure());
            Assert.AreEqual(initialStickFigure, hangingMan.GetStickFigure());
        }