Esempio n. 1
0
        public void ShouldNotReserveWhenHandFull()
        {
            var reservee = new Player("Goku");

            reservee.TryReserve(new Development(1, 1, TokenColor.Red, new TokenCollection()));
            reservee.TryReserve(new Development(1, 1, TokenColor.Red, new TokenCollection()));
            reservee.TryReserve(new Development(1, 1, TokenColor.Red, new TokenCollection()));

            var players = new List <Player>()
            {
                reservee,
                new Player("Vegeta"),
                new Player("Trunks")
            };

            var board = new GameBoard((PlayerCount)players.Count, new List <Noble>(), _developments);

            var toReserve = board.PublicDevelopments.First();

            var sut = new ReserveDevelopmentAction(Location.Public, toReserve);

            Assert.IsFalse(sut.TryExecuteAction(reservee, board, out var result));

            Assert.AreEqual(ExecutionResult.HandFull, result);
        }
Esempio n. 2
0
        public void ShouldNotReserveIfNotInPublicSpace()
        {
            var reservee        = new Player("Goku");
            var fakeDevelopment = new Development(1, 1, TokenColor.Red, new TokenCollection());

            var players = new List <Player>()
            {
                reservee,
                new Player("Vegeta"),
                new Player("Trunks")
            };

            var board = new GameBoard((PlayerCount)players.Count, new List <Noble>(), _developments);

            var sut = new ReserveDevelopmentAction(Location.Public, fakeDevelopment);

            Assert.IsFalse(sut.TryExecuteAction(reservee, board, out var result));

            Assert.AreEqual(ExecutionResult.InvalidDevelopmentToReserve, result);
        }
Esempio n. 3
0
        public void ShouldReserveDevelopmentFromPublicArea()
        {
            var reservee = new Player("Goku");

            var players = new List <Player>()
            {
                reservee,
                new Player("Vegeta"),
                new Player("Trunks")
            };

            var board = new GameBoard((PlayerCount)players.Count, new List <Noble>(), _developments);

            var toReserve = board.PublicDevelopments.First();

            var sut = new ReserveDevelopmentAction(Location.Public, toReserve);

            Assert.IsTrue(sut.TryExecuteAction(reservee, board, out var result));

            Assert.AreEqual(ExecutionResult.Success, result);
        }
Esempio n. 4
0
        public void ShouldReserveFromDeck()
        {
            var reservee = new Player("Goku");

            var players = new List <Player>()
            {
                reservee,
                new Player("Vegeta"),
                new Player("Trunks")
            };

            var board = new GameBoard((PlayerCount)players.Count, new List <Noble>(), _developments);

            var sut = new ReserveDevelopmentAction(Location.Level2Deck, null);

            Assert.IsTrue(sut.TryExecuteAction(reservee, board, out var result));

            Assert.AreEqual(ExecutionResult.Success, result);

            Assert.AreEqual(1, reservee.ReservedDevelopments.Count);

            Assert.AreEqual(2, reservee.ReservedDevelopments.First().Level);
        }