Пример #1
0
        public void LastAttemptFailsLongInput()
        {
            MasterMindGame masterMindTest = new MasterMindGame(6, 2);

            masterMindTest.SolveAttempt("11111");
            Assert.IsTrue(masterMindTest.LastAttemptResults() == "");
        }
Пример #2
0
        public void LastAttemptCanWin()
        {
            MasterMindGame masterMindTest = new MasterMindGame(6, 2);

            masterMindTest.SolveAttempt(masterMindTest.CorrectNumbers);
            Assert.IsTrue(masterMindTest.LastAttemptResults() == "++++");
        }
Пример #3
0
        public void SolveAttemptNotNumbers()
        {
            MasterMindGame masterMindTest = new MasterMindGame(1, 1);

            masterMindTest.SolveAttempt("ASDF");
            Assert.IsTrue(masterMindTest.GoodEntry == false);
        }
Пример #4
0
        public void SolveAttemptLongEntry()
        {
            MasterMindGame masterMindTest = new MasterMindGame(6, 1);

            masterMindTest.SolveAttempt("12341");
            Assert.IsTrue(masterMindTest.GoodEntry == false);
        }
Пример #5
0
        public void SolveAttemptGoodEntry()
        {
            MasterMindGame masterMindTest = new MasterMindGame(1, 1);

            masterMindTest.SolveAttempt("1111");
            Assert.IsTrue(masterMindTest.GoodEntry == true);
        }
Пример #6
0
        public void LastAttemptFailsNotNumbers()
        {
            MasterMindGame masterMindTest = new MasterMindGame(6, 2);

            masterMindTest.SolveAttempt("ASDF");
            Assert.IsTrue(masterMindTest.LastAttemptResults() == "");
        }
Пример #7
0
        public void LastAttemptFailsIncorrectRange()
        {
            MasterMindGame masterMindTest = new MasterMindGame(6, 2);

            masterMindTest.SolveAttempt("7777");
            Assert.IsTrue(masterMindTest.LastAttemptResults() == "");
        }
Пример #8
0
        public void LastAttemptTwoIncorrecttPositionOneCorrect()
        {
            MasterMindGame masterMindTest = new MasterMindGame(6, 2);

            masterMindTest.SetCorrectNumbers("1234");
            masterMindTest.SolveAttempt("3164");
            Assert.IsTrue(masterMindTest.LastAttemptResults() == "+--");
        }
Пример #9
0
        public void LastAttemptThreeCorrectPosition()
        {
            MasterMindGame masterMindTest = new MasterMindGame(6, 2);

            masterMindTest.SetCorrectNumbers("1234");
            masterMindTest.SolveAttempt("1233");
            Assert.IsTrue(masterMindTest.LastAttemptResults() == "+++");
        }
Пример #10
0
        public void LastAttemptWrongPosition()
        {
            MasterMindGame masterMindTest = new MasterMindGame(6, 2);

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