public void ConstructWarriorPlayerSucceeds() { StatisticsService statService = new StatisticsService(); IPlayer warrior = new WarriorDecorator(new BasicPlayer(), statService, "Flame Sword", 15); Assert.IsNotNull(warrior); Assert.IsTrue(warrior.Attack() == 25); Assert.IsTrue(warrior.Defend() == 10); Assert.IsTrue(statService.SpellsCast == 0); Assert.IsTrue(statService.WeaponStikes == 1); }
public void ConstructWarriorMagePlayerSucceeds() { StatisticsService statService = new StatisticsService(); IPlayer player = new BasicPlayer(); IPlayer mage = new MageDecorator(player, statService, "Magic Shield", 15); IPlayer warriorMage = new WarriorDecorator(mage, statService, "Flame Sword", 15); Assert.IsNotNull(warriorMage); Assert.IsTrue(warriorMage.Attack() == 25); Assert.IsTrue(warriorMage.Defend() == 25); Assert.IsTrue(statService.SpellsCast == 1); Assert.IsTrue(statService.WeaponStikes == 1); }