public void Eqip_ToMuch()
        {
            var human = new TestCharacters().InjuerdHuman;
            var sword = new TestItems().Sword;

            human.Eqip(sword);
            human.Eqip(sword);
            Assert.Throws <WrongRequirementException>(() => human.Eqip(sword));
        }
        public void Eqip_twice()
        {
            var elve = new TestCharacters().Elve;

            var sword = new TestItems().Sword;

            elve.Eqip(sword);
            elve.Eqip(sword);
            elve.Eqipped.Should().BeEquivalentTo(new List <StaticItem> {
                sword, sword
            });
        }
        public void GetModifiedFluentAttributes_SeveralEquipped()
        {
            var human         = new TestCharacters().InjuerdHuman;
            var amuletOfLife  = new TestItems().AmuletOfLife;
            var amulettOfDead = new TestItems().AmuletOfDead;

            human.Eqip(amuletOfLife);
            human.Eqip(amulettOfDead);

            var testData = human.GetModifiedFluentAttributes();

            testData.LifePoints.Should().Be(13);
        }
        public void GetModifiedAttributes_SeveralEquipped()
        {
            var human = new TestCharacters().InjuerdHuman;
            var sword = new TestItems().Sword;
            var axe   = new TestItems().Axe;

            human.Eqip(sword);
            human.Eqip(axe);

            var testData = human.GetModifiedAttributes();

            testData.AttackPoints.Should().Be(11);
            testData.DefendPoints.Should().Be(4);
        }
        public void Eqip_Several()
        {
            var elve   = new TestCharacters().Elve;
            var amulet = new TestItems().ElvishAmulet;
            var sword  = new TestItems().Sword;
            var axe    = new TestItems().Axe;

            elve.Eqip(sword);
            elve.Eqip(axe);
            elve.Eqip(amulet);
            elve.Eqipped.Should().BeEquivalentTo(new List <StaticItem> {
                amulet, sword, axe
            });
        }
        public void Eqip_InvalidItem()
        {
            var human  = new TestCharacters().InjuerdHuman;
            var amulet = new TestItems().ElvishAmulet;

            Assert.Throws <WrongRequirementException>(() => human.Eqip(amulet));
        }
        public void Eqip_Amulet()
        {
            var elve   = new TestCharacters().Elve;
            var amulet = new TestItems().ElvishAmulet;

            elve.Eqip(amulet);
            elve.Eqipped.Should().BeEquivalentTo(new List <StaticItem> {
                amulet
            });
        }
        public void Eqip_Sword()
        {
            var human = new TestCharacters().InjuerdHuman;
            var sword = new TestItems().Sword;

            human.Eqip(sword);
            human.Eqipped.Should().BeEquivalentTo(new List <StaticItem> {
                sword
            });
        }
Exemple #9
0
        public void Apply_useHeathPoitionOnEqipedCharcater()
        {
            var healthPotion = new TestItems().HealthPotion;
            var elve         = new TestCharacters().Elve;
            var amuelet      = new TestItems().ElvishAmulet;

            elve.Eqip(amuelet);

            healthPotion.Apply(elve);
            elve.CurrentFluentAttributes.LifePoints.Should().Be(18);
        }
        public void GetModifiedFluentAttributes_AmuelettEquipped()
        {
            var human   = new TestCharacters().InjuerdHuman;
            var amulett = new TestItems().AmuletOfLife;

            human.Eqip(amulett);

            var testData = human.GetModifiedFluentAttributes();

            testData.LifePoints.Should().Be(20);
        }
        public void GetModifiedAttributes_SwordEquipped()
        {
            var human = new TestCharacters().InjuerdHuman;
            var sword = new TestItems().Sword;

            human.Eqip(sword);

            var testData = human.GetModifiedAttributes();

            testData.AttackPoints.Should().Be(8);
            testData.DefendPoints.Should().Be(5);
        }
        public void Attack_EqiuppedElve_Attacks_Human()
        {
            var human = new TestCharacters().InjuerdHuman;
            var elve  = new TestCharacters().Elve;
            var sword = new TestItems().Sword;

            elve.Eqip(sword);
            elve.Attack(human);

            human.CurrentFluentAttributes.LifePoints.Should().BeLessOrEqualTo(0)
            .And.BeGreaterOrEqualTo(-5);
        }