예제 #1
0
        public void MoveTest_DestinationReachedWhilePassingGo()
        {
            StubIBoard stubBoard = CreateStubBoardWithOnlyGoSpaceGiving200OnWalk();

            Game.Instance.InitializeBoard(stubBoard);

            StubIView stubView = CreateStubViewSkippingUserInputAndPauses();

            Game.Instance.View = stubView;


            Player p0 = new Player(0, "P0", 1500, 'x', Game.Instance);

            Assert.AreEqual(0, p0.CurrentPosition);

            p0.Move(Game.Instance.Board.Count + 5);

            Assert.AreEqual(5, p0.CurrentPosition);
            Assert.AreEqual(1700, p0.Money);
        }
예제 #2
0
        public void TeleportTest_PassingGo()
        {
            StubIBoard stubBoard = CreateStubBoardWithOnlyGoSpaceGiving200OnWalk();

            Game.Instance.InitializeBoard(stubBoard);

            StubIView stubView = CreateStubViewSkippingUserInputAndPauses();

            Game.Instance.View = stubView;


            Player p0 = new Player(0, "P0", 1500, 'x', Game.Instance);

            Assert.AreEqual(0, p0.CurrentPosition);

            p0.Move(5);
            Assert.AreEqual(5, p0.CurrentPosition);

            p0.Teleport(stubBoard.GoSpaceGet(), true);

            Assert.AreEqual(0, p0.CurrentPosition);
            Assert.AreEqual(1700, p0.Money);
        }