Esempio n. 1
0
        public void BattleParticipantCreatorSideTest()
        {
            var battle  = CreateTestBattle();
            var creator = new BattleParticipantCreator();

            Assert.IsTrue(creator.Create(battle, true).IsAttacker);
            Assert.IsFalse(creator.Create(battle, false).IsAttacker);
        }
Esempio n. 2
0
        public void BattleParticipantCreatorHasBattleAttached()
        {
            var battle  = CreateTestBattle();
            var creator = new BattleParticipantCreator();

            var part = creator.Create(battle, true);

            Assert.IsTrue(part.Battle == battle);
            Assert.IsTrue(part.BattleID == battle.ID);
        }
Esempio n. 3
0
        public void BattleParticipantCreatorMinMaxDamageTest()
        {
            var battle  = CreateTestBattle();
            var creator = new BattleParticipantCreator();

            for (int i = 0; i < 100; ++i) //we are testing rand so we need more iterations
            {
                creator.MinDamage = 50;
                creator.MaxDamage = 250;

                var participant = creator.Create(battle, true);

                Assert.IsTrue((double)participant.DamageDealt >= creator.MinDamage);
                Assert.IsTrue((double)participant.DamageDealt <= creator.MaxDamage);
            }
        }