예제 #1
0
        public NormalLogic()
        {
            this.randomNumberGenerator = RandomNumberGenerator.Instance;
            this.scoreBoard = new ScoreBoard();
            this.messanger = new ColoredMessenger(new DefaultMessenger());

            this.ResetGameVariables();
        }
예제 #2
0
        public void TestScoreBoardEmptyList()
        {
            ScoreBoard sc = new ScoreBoard();

            string actual = sc.ToString();
            string expected = "\nTop Score Board:\n\n-- Score Board is Empty --\n";

            Assert.AreEqual(expected, actual);
        }
예제 #3
0
        public void TestScoreBoardSeveralPlayersWithSameScore()
        {
            ScoreBoard sc = new ScoreBoard();

            sc.Enter(1, "Pesho");
            sc.Enter(2, "Mitko");
            sc.Enter(2, "Dimitar");

            string actual = sc.ToString();
            string expected = "\nTop Score Board:\n1. Pesho --> 1 guesses\n2. Mitko --> 2 guesses\n2. Dimitar --> 2 guesses\n";

            Assert.AreEqual(actual, expected);
        }
예제 #4
0
        public void TestScoreBoardEnterMethod()
        {
            ScoreBoard sc = new ScoreBoard();

            sc.Enter(1, "Mitko");
            sc.Enter(2, "Niki");
            sc.Enter(3, "Conko");
            sc.Enter(4, "Viki");
            sc.Enter(5, "Viki");

            bool actual = sc.HasToSaveScore(6);
            bool expected = false;

            Assert.AreEqual(expected, actual);
        }