Esempio n. 1
0
            public void DifficultyRange(ElementalTypes type, int difficulty)
            {
                const int MaxDeviation_ATT = 2;
                const int MaxDeviation_DEF = 2;

                int    targetvalue_att = difficulty * 2;
                int    targetvalue_def = difficulty * 4;
                Entity ent             = ElementalFactory.createElemental(type, difficulty);
                int    deviation_att   = Math.Abs(targetvalue_att - ent.Attack);
                int    deviation_def   = Math.Abs(targetvalue_def - ent.Defence);

                Assert.IsTrue(deviation_att <= MaxDeviation_ATT);
                Assert.IsTrue(deviation_def <= MaxDeviation_DEF);
            }
Esempio n. 2
0
            //[DataRow(ElementalTypes.lightning, typeof(LightningElemental))]
            public void ClassValidity(ElementalTypes type, Type expected)
            {
                const int DIFF = 1;
                Entity    ent  = ElementalFactory.createElemental(type, DIFF);

                try
                {
                    Convert.ChangeType(ent, expected);
                }
                catch
                {
                    Assert.Fail();
                }
            }