Пример #1
0
        private void GenerateAndAssertRandomItems()
        {
            var level = GetNewLevel();
            var items = itemsGenerator.GenerateRandomAtLevel(level);

            Assert.That(items, Is.Not.Null);

            if (level > 20)
            {
                Assert.That(items, Is.Not.Empty, $"Level {level}");
            }

            foreach (var item in items)
            {
                itemVerifier.AssertItem(item);
            }
        }
Пример #2
0
        private void GenerateAndAssertTreasure()
        {
            var level    = GetNewLevel();
            var treasure = treasureGenerator.GenerateAtLevel(level);

            if (string.IsNullOrEmpty(treasure.Coin.Currency))
            {
                Assert.That(treasure.Coin.Currency, Is.Empty);
                Assert.That(treasure.Coin.Quantity, Is.Zero);
            }
            else
            {
                Assert.That(treasure.Coin.Currency, Is.EqualTo(CoinConstants.Copper)
                            .Or.EqualTo(CoinConstants.Gold)
                            .Or.EqualTo(CoinConstants.Platinum)
                            .Or.EqualTo(CoinConstants.Silver));
                Assert.That(treasure.Coin.Quantity, Is.Positive);
            }

            Assert.That(treasure.Goods, Is.Not.Null, "goods");

            foreach (var good in treasure.Goods)
            {
                Assert.That(good.Description, Is.Not.Empty);
                Assert.That(good.ValueInGold, Is.Positive);
            }

            Assert.That(treasure.Items, Is.Not.Null, "items");

            if (level > 20)
            {
                Assert.That(treasure.Items, Is.Not.Empty, $"Level {level}");
            }

            foreach (var item in treasure.Items)
            {
                itemVerifier.AssertItem(item);
            }
        }
Пример #3
0
        public void GeneratePotion(string itemName, string power)
        {
            var item = PotionGenerator.Generate(power, itemName);

            itemVerifier.AssertItem(item);
        }
        public void GenerateAlchemicalItem(string itemName)
        {
            var item = alchemicalItemGenerator.Generate(itemName);

            itemVerifier.AssertItem(item);
        }
        public void GenerateWondrousItem(string itemName, string power)
        {
            var item = WondrousItemGenerator.Generate(power, itemName);

            itemVerifier.AssertItem(item);
        }
 protected void AssertItem(Item item)
 {
     ItemVerifier.AssertItem(item);
     MakeSpecificAssertionsAgainst(item);
 }
Пример #7
0
        public void GenerateTool(string itemName)
        {
            var item = toolGenerator.Generate(itemName);

            itemVerifier.AssertItem(item);
        }
        public void GenerateArmor(string itemName, string power)
        {
            var item = ArmorGenerator.Generate(power, itemName);

            itemVerifier.AssertItem(item);
        }
Пример #9
0
        public void GenerateStaff(string itemName, string power)
        {
            var item = StaffGenerator.Generate(power, itemName);

            itemVerifier.AssertItem(item);
        }
Пример #10
0
        public void GenerateArmor(string itemName)
        {
            var item = armorGenerator.Generate(itemName);

            itemVerifier.AssertItem(item);
        }
Пример #11
0
        public void GenerateWeapon(string itemName)
        {
            var item = weaponGenerator.Generate(itemName);

            itemVerifier.AssertItem(item);
        }