Ejemplo n.º 1
0
        public void Apply_useHeathPoitionToGetMaxLife()
        {
            var healthPotion = new TestItems().HealthPotion;
            var injuerdHuman = new TestCharacters().InjuerdHuman;

            healthPotion.Apply(injuerdHuman);
            healthPotion.Apply(injuerdHuman);
            injuerdHuman.CurrentFluentAttributes.LifePoints.Should().Be(15);
        }
Ejemplo n.º 2
0
        public void Apply_useHeathPoitionOnWrongCharacter()
        {
            var healthPotion = new TestItems().HealthPotion;
            var wolf         = new TestCharacters().Wolf;

            Assert.Throws <WrongRequirementException>(() => healthPotion.Apply(wolf));
        }
Ejemplo n.º 3
0
        public void Apply_useHeathPoitionOnHealthyCharcater()
        {
            var healthPotion = new TestItems().HealthPotion;
            var elve         = new TestCharacters().Elve;

            healthPotion.Apply(elve);

            elve.CurrentFluentAttributes.LifePoints.Should().Be(13);
        }
Ejemplo n.º 4
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);
        }
Ejemplo n.º 5
0
        public void Apply_useHeathPoitionDependsOnModifiedFluidAttributes()
        {
            var healthPotion = new TestItems().HealthPotion;
            var elve         = Substitute.For <Character>();
            var baseElve     = new TestCharacters().Elve;

            elve.BaseFluentAttributes    = baseElve.BaseFluentAttributes;
            elve.CurrentFluentAttributes = baseElve.CurrentFluentAttributes;
            elve.Features = baseElve.Features;
            elve.GetModifiedFluentAttributes().Returns(new CharacterFluentAttributes {
                LifePoints = 20
            });

            healthPotion.Apply(elve);
            elve.CurrentFluentAttributes.LifePoints.Should().Be(19);
        }