public void SwordsmanVsViking() { Warrior swordsman = new Swordsman(); Viking viking = new Viking(); swordsman.Engage(viking); Assert.AreEqual(0, swordsman.HitPoints()); Assert.AreEqual(35, viking.HitPoints()); }
public void ArmoredSwordsmanVsHighlander() { Highlander highlander = new Highlander(); Swordsman swordsman = new Swordsman() .Equip("buckler") .Equip("armor"); swordsman.Engage(highlander); Assert.AreEqual(0, swordsman.HitPoints()); Assert.AreEqual(10, highlander.HitPoints()); }
public void SwordsmanWithBucklerVsVikingWithBuckler() { Swordsman swordsman = new Swordsman() .Equip("buckler"); Viking viking = new Viking() .Equip("buckler"); swordsman.Engage(viking); Assert.AreEqual(0, swordsman.HitPoints()); Assert.AreEqual(70, viking.HitPoints()); }
public void ViciousSwordsmanVsVeteranHighlander() { Swordsman swordsman = new Swordsman("Vicious") .Equip("axe") .Equip("buckler") .Equip("armor"); Highlander highlander = new Highlander("Veteran"); swordsman.Engage(highlander); Assert.AreEqual(1, swordsman.HitPoints()); Assert.AreEqual(0, highlander.HitPoints()); }
static void Main(string[] args) { //Console.WriteLine("Give me equipment data file"); //var equipmentfile = Console.ReadLine(); var equipmentfile = "Equipment.cfg"; ReadData.ReadFile(equipmentfile); Warrior w1 = new Swordsman(); Warrior w2 = new Viking(); w1.AddModifier(new DamageModifier(10, 3), "sword"); w1.SetModifierTotal(new DamageModifier(0, 2)); w2.Equip("buckler"); Console.WriteLine(w1.HitPoints().ToString() + " x " + w2.HitPoints().ToString()); w1.Engage(w2); Console.WriteLine(w1.HitPoints().ToString() + " x " + w2.HitPoints().ToString()); Console.ReadLine(); }