Exemple #1
0
        public void AddingDuplicateSpellsDoesNotDuplicate()
        {
            var spellList = new SpellList();

            spellList.Add(1, "Cure Light Wounds");
            spellList.Add(1, "Cure Light Wounds");
            spellList.Add(1, "Cure Light Wounds");
            Assert.Equal(new string[] { "Cure Light Wounds" }, spellList.GetAllSpells(1));
        }
Exemple #2
0
        public void LoadsConfigurationInformationForSpellLists()
        {
            var configuration = @"---
class: foo
levels:
  0: [read stuff, do stuff]
  1: [kill, explosion]".ParseYaml();
            var spellList     = new SpellList(configuration);

            Assert.Equal(spellList.Class, "foo");
            Assert.Equal(1, spellList.GetHighestSpellLevel());
            AssertExtensions.EquivalentLists(new string[] { "read stuff", "do stuff" }, spellList.GetAllSpells(0));
            AssertExtensions.EquivalentLists(new string[] { "kill", "explosion" }, spellList.GetAllSpells(1));
            Assert.True(spellList.Matches("FOO"));
        }
Exemple #3
0
        public void ReturnEmptyListIfLevelDoesNotExists()
        {
            var spellList = new SpellList();

            AssertExtensions.EquivalentLists(new string[] { }, spellList.GetAllSpells(0));
        }
Exemple #4
0
 public IEnumerable <string> GetKnownSpells(int spellLevel)
 {
     return(SpellList.GetAllSpells(spellLevel));
 }