Ejemplo n.º 1
0
        public void TestCannotAdaptOver6()
        {
            GameController gc = new GameController();
            Player p = gc.Players.Find(delegate(Player pl) { return pl.Animal == Animal.Arachnid; });

            // Fill the list
            for(int i = 0; i < 4; i++)
                gc.AddElementToPlayer(p, Chit.ElementType.Grub);

            try
            {
                gc.AddElementToPlayer(p, Chit.ElementType.Grub);
                Assert.Fail("Was able to Adapt to more than 6 elements");
            }
            catch (Exception) {}
        }
Ejemplo n.º 2
0
        public void TestAmphibianGetsLessAdaptation()
        {
            GameController gc = new GameController();
            Player p = gc.Players.Find(delegate(Player pl) { return pl.Animal == Animal.Amphibian; });

            // Fill the list
            for(int i = 0; i < 3; i++)
                gc.AddElementToPlayer(p, Chit.ElementType.Grub);

            try
            {
                gc.AddElementToPlayer(p, Chit.ElementType.Grub);
                Assert.Fail("Was able to Adapt to more than 6 elements");
            }
            catch (Exception) {}
        }
Ejemplo n.º 3
0
        public void TestCanAdapt()
        {
            GameController gc = new GameController();
            Player p = gc.Players[0];

            int beginCount = 0;
            foreach(Chit.ElementType element in Enum.GetValues(typeof(Chit.ElementType)))
                beginCount += p.AdaptationTo(element);

            gc.AddElementToPlayer(p, Chit.ElementType.Grass);

            int endCount = 0;
            foreach(Chit.ElementType element in Enum.GetValues(typeof(Chit.ElementType)))
                endCount += p.AdaptationTo(element);

            Assert.AreEqual(beginCount + 1, endCount);
        }