예제 #1
0
        public void HeroShouldGainExperianceWhenTargetDies()
        {
            Hero    hero   = new Hero("Pesho", new FakeWeapon());
            ITarget target = new FakeTarget();

            hero.Attack(target);

            Assert.That(hero.Experience, Is.EqualTo(10), "Hero doesn't gain experiance!");
        }
예제 #2
0
        public void HeroGetsExperinceWhenTargetIsDead()
        {
            var fakeTarget = new FakeTarget();
            var fakeWeapon = new FakeWeapon();
            var hero       = new Hero(HeroName, fakeWeapon);

            hero.Attack(fakeTarget);

            Assert.AreEqual(TargetXP, hero.Experience, "Hero does not get targets XP!");
        }
예제 #3
0
        public void HeroShouldGainExperinceWhenKillsATarget()
        {
            ITarget target = new FakeTarget();
            IWeapon weapon = new FakeWeapon();
            Hero    hero   = new Hero(HeroName, weapon);

            hero.Attack(target);

            Assert.AreEqual(20, hero.Experience, "The hero does not gain experience after killing a target.");
        }
예제 #4
0
        public void HeroGainsExperienceAfterAttackWhenTargetDies()
        {
            IWeapon fakeWeapon = new FakeWeapon();
            ITarget fakeTarget = new FakeTarget();

            Hero hero = new Hero(HERO_NAME, fakeWeapon);

            hero.Attack(fakeTarget);

            Assert.AreEqual(40, hero.Experience + fakeTarget.GiveExperience());
        }
예제 #5
0
        public void HeroGainingExpiriance()
        {
            ITarget fakeTarget     = new FakeTarget();
            IWeapon fakeWeapon     = new FakeWeapon();
            Hero    hero           = new Hero(Name, fakeWeapon);
            int     initialHeroEXP = hero.Experience;

            hero.Attack(fakeTarget);

            //1990 is the fake exp the dummy will give to Hero and it will always return Isdead=true!
            Assert.That(initialHeroEXP + 1990 == hero.Experience);
        }
예제 #6
0
        public void HeroGainsXPWhenTargetDies()
        {
            IWeapon fakeWeapon = new FakeWeapon();

            Hero hero = new Hero("Ivo", fakeWeapon);

            ITarget target = new FakeTarget();

            hero.Attack(target);

            Assert.That(hero.Experience, Is.EqualTo(target.GiveExperience()));
        }
예제 #7
0
        public void HeroGainsXPAfterAttackIfTargetDies()
        {
            IWeapon weapon = new FakeWeapon();
            ITarget target = new FakeTarget();

            Hero hero = new Hero("Ilko", weapon);

            hero.Attack(target);
            int expectedXP = 20;


            Assert.That(hero.Experience, Is.EqualTo(expectedXP)
                        , "Hero doesnt gain Xp after kill");
        }
예제 #8
0
        public void HeroCanTakeXP()
        {
            int attack      = 10;
            int durability  = 10;
            int enemyXP     = 10;
            int enemyHealth = 3;

            IWeapon axe    = new FakeWeapon();
            ITarget target = new FakeTarget();
            Hero    hero   = new Hero("Stamat", axe);

            hero.Attack(target);

            Assert.That(hero.Experience, Is.EqualTo(target.GiveExperience()));
        }