public void When_the_game_starts_should_say_welcome_to_master_mind()
        {
            GuessMarker guessMarker = new GuessMarker(dataReader,dataWriter,"rgby");

            mock.ReplayAll();

            guessMarker.start();

            dataWriter.AssertWasCalled(x => x.WriteData("Welcome to Master Mind. Please make a guess:"));
        }
Example #2
0
        public void When_the_game_starts_should_say_welcome_to_master_mind()
        {
            GuessMarker guessMarker = new GuessMarker(dataReader, dataWriter, "rgby");

            mock.ReplayAll();

            guessMarker.start();

            dataWriter.AssertWasCalled(x => x.WriteData("Welcome to Master Mind. Please make a guess:"));
        }
        public void TestMarkingGuess(string result,string guess, string secret)
        {
            Expect.Call(dataReader.getInputData()).Return(guess);
            Expect.Call(randomSecret.NextSecret()).Return(secret);
            mock.ReplayAll();

            GuessMarker guessMarker = new GuessMarker(dataReader, dataWriter, randomSecret);
            guessMarker.Step();

            dataWriter.AssertWasCalled(x => x.WriteData(result));
        }
Example #4
0
        public void TestMarkingGuess(string result, string guess, string secret)
        {
            Expect.Call(dataReader.getInputData()).Return(guess);
            Expect.Call(randomSecret.NextSecret()).Return(secret);
            mock.ReplayAll();

            GuessMarker guessMarker = new GuessMarker(dataReader, dataWriter, randomSecret);

            guessMarker.Step();

            dataWriter.AssertWasCalled(x => x.WriteData(result));
        }
        public static void Main(string[] args)
        {
            IDataReader dataRead = new ConsoleDataReader();
            IDataWriter dataWrite = new ConsoleDataWriter();
            string secret;
            GuessMarker marker;

            if (args != null && args.Length > 0)
            {
                secret = args[0];
                marker = new GuessMarker(dataRead, dataWrite, secret);
            }
            else
            {
                marker = new GuessMarker(dataRead, dataWrite, new RandomSecret());
            }

            marker.start();
            while (true)
            {
                marker.Step();
            }
        }
Example #6
0
        public static void Main(string[] args)
        {
            IDataReader dataRead  = new ConsoleDataReader();
            IDataWriter dataWrite = new ConsoleDataWriter();
            string      secret;
            GuessMarker marker;

            if (args != null && args.Length > 0)
            {
                secret = args[0];
                marker = new GuessMarker(dataRead, dataWrite, secret);
            }
            else
            {
                marker = new GuessMarker(dataRead, dataWrite, new RandomSecret());
            }

            marker.start();
            while (true)
            {
                marker.Step();
            }
        }
 public void TestModelMarkingGuesses(string result, string guess, string secret)
 {
     GuessMarker guessMarker = new GuessMarker(dataReader,dataWriter,secret);
     Assert.AreEqual(result,guessMarker.Mark(guess));
 }
Example #8
0
        public void TestModelMarkingGuesses(string result, string guess, string secret)
        {
            GuessMarker guessMarker = new GuessMarker(secret);

            Assert.AreEqual(result, guessMarker.Mark(guess));
        }