Example #1
0
        public void TestWhenSpecifyingBigBangMode_ThenFirstMoveIsDynamite()
        {
            var target = new MyBot_Accessor();
            target.Mode = MoveMode.BigBang;
            var testPlayer = new Player("Test", target);

            IPlayer opponent = new Player("Opponent", new MyBot());
            Move expected = Moves.Dynamite;
            Move actual = target.MakeMove(testPlayer, opponent, GameRules.Default);
            Assert.AreEqual(expected, actual, "Big Bang always starts with Dynamite.");
        }
Example #2
0
        public void TestWhenCausingAnExceptionInMakeMyMove_ThenAValidMoveIsStillReturned()
        {
            var target = new MyBot_Accessor();
            target.History = null;
            var testPlayer = new Player("Test", target);

            IPlayer opponent = new Player("Opponent", new MyBot());
            Move notExpected = Moves.WaterBalloon;
            Move actual = target.MakeMove(testPlayer, opponent, GameRules.Default);
            Assert.AreNotEqual(notExpected, actual, "Exception move should not return WaterBalloon.");
        }
Example #3
0
        public void TestWhenSpecifyingCycleMode_ThenFirstMoveIsRock()
        {
            var target = new MyBot_Accessor();
            target.Mode = MoveMode.Cycle;
            var testPlayer = new Player("Test", target);

            IPlayer opponent = new Player("Opponent", new MyBot());
            Move expected = Moves.Rock;
            Move actual = target.MakeMove(testPlayer, opponent, GameRules.Default);
            Assert.AreEqual(expected, actual, "Cycle always starts with Rock.");
        }