예제 #1
0
        public void TestSpellNameChange()
        {
            Spell s = new Teleport ("Mitch's mighty mover");

            StringAssert.IsMatch ("Mitch's mighty mover", s.Name);

            s.Name = "Pete's powerful puller";

            StringAssert.IsMatch ("Pete's powerful puller", s.Name);
        }
예제 #2
0
        public void TestRemoveSpell()
        {
            SpellBook myBook = new SpellBook ();

            Spell mySpell1 = new Teleport ("Sean's Teleporter");
            Spell mySpell2 = new Heal ("Tom's Healer");
            Spell mySpell3 = new Invisibilty ("Ian's Invisibilty");

            myBook.AddSpell (mySpell1);
            myBook.AddSpell (mySpell2);
            myBook.AddSpell (mySpell3);

            Assert.AreEqual (3, myBook.SpellCount);

            myBook.RemoveSpell (mySpell2);

            Assert.AreEqual (2, myBook.SpellCount);
        }
예제 #3
0
 public void TestTeleportCast()
 {
     Spell s = new Teleport ("Teleport");
     string result = s.Cast ();
     Assert.IsTrue (result == "Poof... you appear somewhere else" || result == "Ahhh... I'm too tired to move");
 }