Esempio n. 1
0
        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()));
        }
Esempio n. 2
0
        public void WandsGetMoreExpensiveWithLevels(int level, int expectedValue)
        {
            var spellList = SpellList.CreateForTesting("wizard");

            spellList.Add(level, "Cure Light Wounds");
            var cure         = new Spell("Cure Light Wounds", "healing");
            var spellGateway = EntityGateway <Spell> .LoadWithSingleItem(cure);

            var spellListGateway = EntityGateway <SpellList> .LoadWithSingleItem(spellList);

            var createwands = new WandCreator(spellGateway, spellListGateway);

            var wand = createwands.Process();

            Assert.Equal(expectedValue, wand.Value);
        }
Esempio n. 3
0
        public void WandsUtilizeAvailableListsToMakeWandsThatMakeSense()
        {
            var spellList = SpellList.CreateForTesting("wizard");

            spellList.Add(1, "Cure Light Wounds");
            var cure         = new Spell("Cure Light Wounds", "healing");
            var spellGateway = EntityGateway <Spell> .LoadWithSingleItem(cure);

            var spellListGateway = EntityGateway <SpellList> .LoadWithSingleItem(spellList);

            var createwands = new WandCreator(spellGateway, spellListGateway);

            var wand = createwands.Process();

            Assert.Equal(cure, wand.Spell);
            Assert.Equal(50, wand.Charges);
            Assert.Equal(75000, wand.Value);
        }