Example #1
0
        public void LastAttemptFailsLongInput()
        {
            MasterMindGame masterMindTest = new MasterMindGame(6, 2);

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

            masterMindTest.SolveAttempt(masterMindTest.CorrectNumbers);
            Assert.IsTrue(masterMindTest.LastAttemptResults() == "++++");
        }
Example #3
0
        public void SolveAttemptLongEntry()
        {
            MasterMindGame masterMindTest = new MasterMindGame(6, 1);

            masterMindTest.SolveAttempt("12341");
            Assert.IsTrue(masterMindTest.GoodEntry == false);
        }
Example #4
0
        public void SolveAttemptNotNumbers()
        {
            MasterMindGame masterMindTest = new MasterMindGame(1, 1);

            masterMindTest.SolveAttempt("ASDF");
            Assert.IsTrue(masterMindTest.GoodEntry == false);
        }
Example #5
0
        public void SolveAttemptGoodEntry()
        {
            MasterMindGame masterMindTest = new MasterMindGame(1, 1);

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

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

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

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

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

            masterMindTest.SetCorrectNumbers("1234");
            masterMindTest.SolveAttempt("4321");
            Assert.IsTrue(masterMindTest.LastAttemptResults() == "----");
        }
Example #11
0
        public void IncorrectRangeReturnsFalse()
        {
            MasterMindGame masterMindTest = new MasterMindGame(6, 2);

            Assert.IsFalse(masterMindTest.GoodAttempt("7777"));
        }
Example #12
0
        public void ShortInputReturnsFalse()
        {
            MasterMindGame masterMindTest = new MasterMindGame(6, 2);

            Assert.IsFalse(masterMindTest.GoodAttempt("12"));
        }
Example #13
0
        public void GoodAttemptReturnsTrue()
        {
            MasterMindGame masterMindTest = new MasterMindGame(6, 2);

            Assert.IsTrue(masterMindTest.GoodAttempt("1111"));
        }
Example #14
0
        public Form1()
        {
            MasterMindGame game = new MasterMindGame(20, 4);

            InitializeComponent();
        }