public void RemoveHealthFromOpponentHp_WhenApplied() { //Arrange var casterMock = new Mock <IHero>(); var opponentMock = new Mock <IHero>(); var dmgAbility = new DamagingAbility("Blade Storm", 1, HeroClass.Warrior, EffectType.Damage, 18); casterMock.Setup(x => x.DmgStartOfRange).Returns(10); casterMock.Setup(x => x.DmgEndOfRange).Returns(20); opponentMock.Setup(x => x.HealthPoints).Returns(100); opponentMock.Setup(x => x.HasRessistance).Returns(false); var opponent = new Warrior("Hero", HeroClass.Warrior, 200, 10, 15); casterMock.Setup(x => x.Opponent).Returns(opponent); dmgAbility.Caster = casterMock.Object; //Act dmgAbility.Apply(); //Assert Assert.AreNotEqual(100, opponent.HealthPoints); }
public void ReturnTheProperValue_WhenGetMethodIsCalled() { // Arrange var ability = new DamagingAbility("Pesho", 2, HeroClass.Assasin, EffectType.Damage, 2); // Act var result = ability.Name; // Assert Assert.AreEqual("Pesho", result); }
public void CreateSpellBook(IHero hero) { var spellPool = PopulateSpellPool().Where(x => x.HeroClass == hero.HeroClass); var basicAttack = new DamagingAbility("Basic Attack", 0, hero.HeroClass, EffectType.Damage, 0); hero.Abilities.Add(basicAttack); //add basic attack var dmgAbilities = spellPool.Where(x => x.Type == EffectType.Damage).ToList(); hero.Abilities.Add(dmgAbilities[RandomProvider.Generate(0, dmgAbilities.Count - 1)]); //add 2nd spell //? var effectAbilitues = spellPool.Where(x => x.Type != EffectType.Damage).ToList(); hero.Abilities.Add(effectAbilitues[RandomProvider.Generate(0, effectAbilitues.Count - 1)]); //add 3rd spell foreach (var ability in hero.Abilities) { ability.Caster = hero; } }
public override IAbilityComponent Duplicate() { DamagingAbility copy = new DamagingAbility(Data, ParentAbility); return(copy); }
public void ThrowsArgumentException_WhenInvalidValueIsPassed() { // Arrange var ability = new DamagingAbility("", 2, HeroClass.Assasin, EffectType.Damage, 2); }