コード例 #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);
        }
コード例 #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);
        }
コード例 #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);
            }
        }