Exemplo n.º 1
0
        public void GenerateAlchemicalItem()
        {
            selection.Type   = "alchemical item";
            selection.Amount = 9266;
            mockTypeAndAmountPercentileSelector
            .Setup(p => p.SelectFrom(TableNameConstants.Percentiles.Set.AlchemicalItems))
            .Returns(selection);
            mockTypeAndAmountPercentileSelector
            .Setup(p => p.SelectAllFrom(TableNameConstants.Percentiles.Set.AlchemicalItems))
            .Returns(new[]
            {
                new TypeAndAmountSelection {
                    Type = "wrong item", Amount = 666
                },
                selection
            });

            var item = alchemicalItemGenerator.GenerateRandom();

            Assert.That(item.Name, Is.EqualTo(selection.Type));
            Assert.That(item.BaseNames.Single(), Is.EqualTo(selection.Type));
            Assert.That(item.Quantity, Is.EqualTo(9266));
            Assert.That(item.ItemType, Is.EqualTo(ItemTypeConstants.AlchemicalItem));
            Assert.That(item.Attributes, Is.Empty);
            Assert.That(item.IsMagical, Is.False);
        }
        public Item GenerateRandom()
        {
            var item = innerGenerator.GenerateRandom();

            item = AddSpecialMaterials(item);

            return(item);
        }
Exemplo n.º 3
0
        public void GenerateTool()
        {
            mockPercentileSelector.Setup(p => p.SelectFrom(TableNameConstants.Percentiles.Set.Tools)).Returns("tool");

            var tool = toolGenerator.GenerateRandom();

            Assert.That(tool.Name, Is.EqualTo("tool"));
            Assert.That(tool.BaseNames.Single(), Is.EqualTo("tool"));
            Assert.That(tool.Attributes, Is.Empty);
            Assert.That(tool.ItemType, Is.EqualTo(ItemTypeConstants.Tool));
            Assert.That(tool.IsMagical, Is.False);
            Assert.That(tool.Contents, Is.Empty);
            Assert.That(tool.Quantity, Is.EqualTo(1));
            Assert.That(tool.Traits, Is.Empty);
        }
        public void GetItemFromInnerGenerator()
        {
            var decoratedItem = decorator.GenerateRandom();

            Assert.That(decoratedItem, Is.EqualTo(item));
        }
        public void ReturnArmor()
        {
            var armor = mundaneArmorGenerator.GenerateRandom();

            Assert.That(armor, Is.Not.Null);
            Assert.That(armor, Is.InstanceOf <Armor>());
        }
 protected override Item GenerateItem()
 {
     return(mundaneItemGenerator.GenerateRandom());
 }