public void TestCastSpellWhenHealthIsFull() { Assert.AreEqual(wizard.CastSpell() > 0, true); }
public void TestCastSpellWhenNotEnoughMana() { spell = new Spell("created from unit test", 123, 120); wizard = new Wizard(wizardName, weapon, spell); Assert.AreEqual(wizard.CastSpell() > 0, false); }
static void Main(string[] args) { Console.WriteLine("CLASSES\n"); Wizard wizard01 = new Wizard("Parry Hopper", "Unexpecto Patronum"); wizard01.CastSpell(); Console.WriteLine("\n--------\n"); wizard01.CastSpell(); Console.WriteLine("\n--------\n"); wizard01.CastSpell(); Console.WriteLine("\n--------\n"); wizard01.Medidate(); Console.WriteLine("\n--------\n"); wizard01.CastSpell(); Console.WriteLine("\n--------\n"); wizard01.CastSpell(); Console.WriteLine("\n--------\n"); Wizard wizard02 = new Wizard("Kumar Anurag", "Abracadabra"); wizard02.CastSpell(); Console.WriteLine("\n--------\n"); int count = Wizard.Count; Console.WriteLine("\nTotal no of wizards are: " + count); /* * OUTPUT: * * CLASSES * * Parry Hopper casts Unexpecto Patronum * Current Experience level of Parry Hopper is: 0.3 * * -------- * * Parry Hopper casts Unexpecto Patronum * Current Experience level of Parry Hopper is: 0.6 * * -------- * * Parry Hopper is out of spell slots. * Current Experience level of Parry Hopper is: 0.6 * * -------- * * Parry Hopper meditates to regain spell slots. * * -------- * * Parry Hopper casts Unexpecto Patronum * Current Experience level of Parry Hopper is: 0.90000004 * * -------- * * Parry Hopper casts Unexpecto Patronum * Current Experience level of Parry Hopper is: 1.2 * * -------- * * Kumar Anurag casts Abracadabra * Current Experience level of Kumar Anurag is: 0.3 * * -------- * * * Total no of wizards are: 2 */ }