Esempio n. 1
0
 protected override void DoDisplayContent(ControlDisplay display)
 {
     foreach (string line in hangingMan.GetStickFigure())
     {
         display.WriteRow(line);
     }
 }
Esempio 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());
        }
Esempio n. 3
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());
        }