Esempio n. 1
0
        public void Item()
        {
            SpecificationFamily family = new SpecificationFamily();

            for (int x = 1; x < 6; x++)
            {
                int X = x;
                TemporalSpecification RItem = new Unless(G => G.dungeon.items.Count == X, G => G.dungeon.items.Count < X);
                family.add(RItem);
            }
            Assert.AreEqual(Judgement.RelevantlyValid, family.evaluate(testsuites, threshold));
        }
Esempio n. 2
0
        public void Decay()
        {
            //RDecay: when the game has no item left(lying around in nodes nor in the player’s bag), the player’s HP can only decrease.

            int[] HPValues             = new int[] { 2, 4, 6, 8, 10 };
            SpecificationFamily family = new SpecificationFamily();

            foreach (int x in HPValues)
            {
                int X = x;
                TemporalSpecification RDecay = new Unless(G => G.player.HP == X && (G.dungeon.items.Count <= 0 && G.player.bag.Count <= 0), G => G.player.HP < X);
                family.add(RDecay);
            }
            Assert.AreEqual(Judgement.RelevantlyValid, family.evaluate(testsuites, threshold));
        }
Esempio n. 3
0
        public void monsterHP()
        {
            //RMonster: The HP of every monster can only decrease, and it never leaves its zone.

            SpecificationFamily family = new SpecificationFamily();


            for (int I = 1; I < 5; I++)
            {
                int    i   = I;
                string mid = "M" + i;
                for (int x = 1; x < 6; x += 2) //max hp = 5, player attack = 2 of 4
                {
                    int X = x;
                    TemporalSpecification RMonster1 = new Unless(G => G.getMonster(mid) != null && G.getMonster(mid).HP == X, G => G.getMonster(mid).HP < X);
                    family.add(RMonster1);
                }
            }
            Assert.AreEqual(Judgement.RelevantlyValid, family.evaluate(testsuites, threshold));
        }