public void ChangenameTeleport() { Teleport testingspell1 = new Swinwarts_School_of_Magic.Teleport("abcde"); testingspell1.Probability = 0.5; Assert.AreEqual(testingspell1.Cast(), "Poof...you appear somewhere else"); testingspell1.Name = "xyz"; testingspell1.Probability = 0.5; Assert.AreEqual(testingspell1.Cast(), "Poof...you appear somewhere else"); }
public void TeleportChanceSpell() { Teleport tele = new Teleport(); Spell s = new Swinwarts_School_of_Magic.Teleport("1. Mitch's mighty mover"); int i = 0; while (i < 10) { Console.WriteLine("{0:P}", 1 - tele.Probability); // tele.SpellCast (s); i++; // Console.WriteLine ("Spell succeed="+s.SpellsucceededOrNot); } }