private void StockShop() { var wandBuilder = new WandCreator(); Repeat.Times(100, () => this.inventory.Add(wandBuilder.Process())); var potionCreator = new PotionCreator(); Repeat.Times(100, () => this.inventory.Add(potionCreator.Process())); }
public void SelectAPotionFromAListOfSpellsAndChargesProperly(int level, int value) { var spellList = SpellList.CreateForTesting("cleric"); spellList.Add(level, "Cure Light Wounds"); var cureSpell = new Spell("Cure Light Wounds", "healing"); var spellLists = EntityGateway <SpellList> .LoadWithSingleItem(spellList); var spells = EntityGateway <Spell> .LoadWithSingleItem(cureSpell); var potionCreator = new PotionCreator(spellLists, spells); var potion = potionCreator.Process(); Assert.Equal(cureSpell, potion.Spell); Assert.Equal(value, potion.Value); }
public void MaxSpellLevelIsLevel3() { var spellList = SpellList.CreateForTesting("cleric"); spellList.Add(1, "Cure Light Wounds"); spellList.Add(4, "Cure Serious Wounds"); var cureSpell = new Spell("Cure Light Wounds", "healing"); var cureSeriousSpell = new Spell("Cure Serious Wounds", "healing"); var spellLists = EntityGateway <SpellList> .LoadWithSingleItem(spellList); var spells = EntityGateway <Spell> .LoadFromList(new Spell[] { cureSpell, cureSeriousSpell }); var potionCreator = new PotionCreator(spellLists, spells); var potion = potionCreator.Process(); //Always equals cureSpell Assert.Equal(cureSpell, potion.Spell); }