Exemplo n.º 1
0
        public void LastAttemptCanWin()
        {
            MasterMindGame masterMindTest = new MasterMindGame(6, 2);

            masterMindTest.SolveAttempt(masterMindTest.CorrectNumbers);
            Assert.IsTrue(masterMindTest.LastAttemptResults() == "++++");
        }
Exemplo n.º 2
0
        public void LastAttemptFailsLongInput()
        {
            MasterMindGame masterMindTest = new MasterMindGame(6, 2);

            masterMindTest.SolveAttempt("11111");
            Assert.IsTrue(masterMindTest.LastAttemptResults() == "");
        }
Exemplo n.º 3
0
        public void LastAttemptFailsNotNumbers()
        {
            MasterMindGame masterMindTest = new MasterMindGame(6, 2);

            masterMindTest.SolveAttempt("ASDF");
            Assert.IsTrue(masterMindTest.LastAttemptResults() == "");
        }
Exemplo n.º 4
0
        public void LastAttemptFailsIncorrectRange()
        {
            MasterMindGame masterMindTest = new MasterMindGame(6, 2);

            masterMindTest.SolveAttempt("7777");
            Assert.IsTrue(masterMindTest.LastAttemptResults() == "");
        }
Exemplo n.º 5
0
        public void LastAttemptTwoIncorrecttPositionOneCorrect()
        {
            MasterMindGame masterMindTest = new MasterMindGame(6, 2);

            masterMindTest.SetCorrectNumbers("1234");
            masterMindTest.SolveAttempt("3164");
            Assert.IsTrue(masterMindTest.LastAttemptResults() == "+--");
        }
Exemplo n.º 6
0
        public void LastAttemptThreeCorrectPosition()
        {
            MasterMindGame masterMindTest = new MasterMindGame(6, 2);

            masterMindTest.SetCorrectNumbers("1234");
            masterMindTest.SolveAttempt("1233");
            Assert.IsTrue(masterMindTest.LastAttemptResults() == "+++");
        }
Exemplo n.º 7
0
        public void LastAttemptWrongPosition()
        {
            MasterMindGame masterMindTest = new MasterMindGame(6, 2);

            masterMindTest.SetCorrectNumbers("1234");
            masterMindTest.SolveAttempt("4321");
            Assert.IsTrue(masterMindTest.LastAttemptResults() == "----");
        }