Esempio n. 1
0
        public void TestPoisonousNotDie()
        {
            GameConstructor.Instance.ArrangeTwoAnimals(
                out var game,
                out var player1,
                new List <UpgradeSingle>(),
                out var player2,
                new List <UpgradeSingle>()
            {
                new UpgradePoisonous()
            });
            player1.TryFeedAnimalEvent += (sender, args) => args.Player.Feed(args.Animal);
            player2.TryFeedAnimalEvent += (sender, args) => args.Player.Feed(args.Animal);

            player1.TryFeed(player1.Animals.First());
            player2.TryFeed(player2.Animals.First());

            var phaseEx = new PhaseExtinction(new List <IPlayer>()
            {
                player1, player2
            });

            phaseEx.StartExtinct();

            Assert.Single(player1.Animals);
            Assert.Single(player1.Animals);
        }
Esempio n. 2
0
        public void TestPoisonousSimple()
        {
            GameConstructor.Instance.ArrangeTwoAnimals(
                out var game,
                out var player1,
                new List <UpgradeSingle>()
            {
                new UpgradeCarnivorous()
            },
                out var player2,
                new List <UpgradeSingle>()
            {
                new UpgradePoisonous()
            });
            _victim            = player2.Animals.First();
            game.VictimChoose += OnVictimChoose;

            (player1.Animals.First().Upgrades.First(x => x.UpgradeType == UpgradeType.Carnivorous) as UpgradeCarnivorous).Use();

            var phaseEx = new PhaseExtinction(new List <IPlayer>()
            {
                player1, player2
            });

            phaseEx.StartExtinct();

            Assert.Empty(player1.Animals);
        }
Esempio n. 3
0
        public void TestExtinctionSimpleDie()
        {
            IPlayer player1 = new Player("p1");
            var card = new Card(new UpgradeCarnivorous(), new UpgradeBurrowing());
            player1.AddCard(card);
            player1.AddAnimal(card);
            var phase = new PhaseExtinction(new List<IPlayer>(){player1});

            phase.StartExtinct();

            Assert.Empty(player1.Animals);
        }
Esempio n. 4
0
        public void TestExtinctionSimpleSurvive()
        {
            IPlayer player1 = new Player("p1");
            var card = new Card(new UpgradeCarnivorous(), new UpgradeBurrowing());
            player1.AddCard(card);
            player1.AddAnimal(card);
            player1.Animals.First().AddFood(new FoodToken(true), null);
            var phase = new PhaseExtinction(new List<IPlayer>() { player1 });

            phase.StartExtinct();

            Assert.Single(player1.Animals);
        }
Esempio n. 5
0
        public void TestUseFat()
        {
            var player1 = new Player("player1");

            player1.Animals.AddAnimal();
            var animal = player1.Animals.First();

            animal.AddUpgrade(new UpgradeFat()
            {
                Full = true
            });
            var phaseEx = new PhaseExtinction(new List <IPlayer>()
            {
                player1
            });

            phaseEx.StartExtinct();

            Assert.Single(player1.Animals);
        }