public EncounterGenerator(ITypeAndAmountPercentileSelector typeAndAmountPercentileSelector, IRollSelector rollSelector, IPercentileSelector percentileSelector, ICollectionSelector collectionSelector, Dice dice, IEncounterCharacterGenerator encounterCharacterGenerator, IEncounterTreasureGenerator encounterTreasureGenerator, IFilterVerifier filterVerifier, IEncounterCollectionSelector creatureCollectionSelector) { this.typeAndAmountPercentileSelector = typeAndAmountPercentileSelector; this.rollSelector = rollSelector; this.percentileSelector = percentileSelector; this.collectionSelector = collectionSelector; this.dice = dice; this.encounterTreasureGenerator = encounterTreasureGenerator; this.encounterCharacterGenerator = encounterCharacterGenerator; this.filterVerifier = filterVerifier; this.creatureCollectionSelector = creatureCollectionSelector; challengeRatingRegex = new Regex(RegexConstants.ChallengeRatingPattern); subTypeRegex = new Regex(RegexConstants.DescriptionPattern); }
public void Setup() { mockTypeAndAmountPercentileSelector = new Mock<ITypeAndAmountPercentileSelector>(); mockCollectionSelector = new Mock<ICollectionSelector>(); mockCreatureCollectionSelector = new Mock<IEncounterCollectionSelector>(); mockRollSelector = new Mock<IRollSelector>(); filterVerifier = new FilterVerifier(mockTypeAndAmountPercentileSelector.Object, mockCollectionSelector.Object, mockCreatureCollectionSelector.Object, mockRollSelector.Object); var levelsAndAmounts = new List<Dictionary<string, string>>(); levelsAndAmounts.Add(new Dictionary<string, string>()); levelsAndAmounts.Add(new Dictionary<string, string>()); levelsAndAmounts.Add(new Dictionary<string, string>()); levelsAndAmounts[0]["9265"] = ModifierConstants.TwoThirds.ToString(); levelsAndAmounts[1]["9266"] = ModifierConstants.Same.ToString(); levelsAndAmounts[2]["9267"] = ModifierConstants.Double.ToString(); var tableName = string.Format(TableNameConstants.LevelXEncounterLevel, Level); mockTypeAndAmountPercentileSelector.Setup(s => s.SelectAllFrom(tableName)).Returns(levelsAndAmounts); filterGroup = new List<string>(); filterGroup.Add("creature"); filterGroup.Add("other creature"); mockCollectionSelector.Setup(s => s.SelectFrom(TableNameConstants.CreatureGroups, Filter)).Returns(filterGroup); }