예제 #1
0
        public void Move_ShouldWrapPlayerWhenEndOfBoardIsReached()
        {
            var mover = new Mover(new List<string>());
            mover.SetPlayerLocation("Princie", 39);

            mover.Move("Princie", 6);
            Assert.That(mover.GetPlayerLocation("Princie"), Is.EqualTo(5));
        }
예제 #2
0
        public void Move_ShouldIncreaseThePlayerLocationByTheSpecifiedAmount()
        {
            var mover = new Mover(new List<string> { "Princie" });
            mover.SetPlayerLocation("Princie", 0);

            mover.Move("Princie", 7);

            Assert.That(mover.GetPlayerLocation("Princie"), Is.EqualTo(7));
        }
예제 #3
0
        public void Move_WhenGivenANonexistingPlayer_ShouldThrowAnInvalidPlayerException()
        {
            var mover = new Mover(new List<string>());

            Assert.Throws<InvalidPlayerException>(() => mover.Move("Princie", 7));
        }