public void Setup() { mithralAttributes = new List <string>() { "type 1", "type 2" }; adamantineAttributes = new List <string>() { "type 3", "type 2" }; otherMaterialAttributes = new List <string>() { "type 3", "type 2", "other attribute" }; mockPercentileSelector = new Mock <ITreasurePercentileSelector>(); mockCollectionsSelector = new Mock <ICollectionSelector>(); traits = new List <string>(); mockCollectionsSelector.Setup(s => s.SelectFrom(TableNameConstants.Collections.Set.SpecialMaterials, It.IsAny <string>())).Returns(otherMaterialAttributes); mockCollectionsSelector.Setup(p => p.SelectFrom(TableNameConstants.Collections.Set.SpecialMaterials, TraitConstants.SpecialMaterials.Mithral)).Returns(mithralAttributes); mockCollectionsSelector.Setup(p => p.SelectFrom(TableNameConstants.Collections.Set.SpecialMaterials, TraitConstants.SpecialMaterials.Adamantine)).Returns(adamantineAttributes); specialMaterialsGenerator = new SpecialMaterialGenerator(mockCollectionsSelector.Object, mockPercentileSelector.Object); var count = 0; mockCollectionsSelector.Setup(s => s.SelectRandomFrom(It.IsAny <IEnumerable <string> >())).Returns((IEnumerable <string> c) => c.ElementAt(count++ % c.Count())); }
public void Setup() { mockDice = new Mock <Dice>(); mithralAttributes = new List <string>() { "type 1", "type 2" }; adamantineAttributes = new List <string>() { "type 3", "type 2" }; otherMaterialAttributes = new List <string>() { "type 3", "type 2", "other attribute" }; mockBooleanPercentileSelector = new Mock <IBooleanPercentileSelector>(); mockAttributesSelector = new Mock <ICollectionsSelector>(); traits = new List <string>(); mockAttributesSelector.Setup(s => s.SelectFrom(TableNameConstants.Collections.Set.SpecialMaterials, It.IsAny <string>())).Returns(otherMaterialAttributes); mockAttributesSelector.Setup(p => p.SelectFrom(TableNameConstants.Collections.Set.SpecialMaterials, TraitConstants.SpecialMaterials.Mithral)).Returns(mithralAttributes); mockAttributesSelector.Setup(p => p.SelectFrom(TableNameConstants.Collections.Set.SpecialMaterials, TraitConstants.SpecialMaterials.Adamantine)).Returns(adamantineAttributes); specialMaterialsGenerator = new SpecialMaterialGenerator(mockDice.Object, mockAttributesSelector.Object, mockBooleanPercentileSelector.Object); }
public MundaneItemGeneratorSpecialMaterialDecorator(MundaneItemGenerator innerGenerator, ISpecialMaterialGenerator specialMaterialGenerator, ICollectionSelector collectionsSelector) { this.innerGenerator = innerGenerator; this.specialMaterialGenerator = specialMaterialGenerator; this.collectionsSelector = collectionsSelector; }
public MagicalItemGeneratorSpecialMaterialDecorator(MagicalItemGenerator innerGenerator, ISpecialMaterialGenerator specialMaterialGenerator) { this.innerGenerator = innerGenerator; this.specialMaterialGenerator = specialMaterialGenerator; }