Exemplo n.º 1
0
        public CharacterGenerator(IAlignmentGenerator alignmentGenerator, ICharacterClassGenerator characterClassGenerator, IRaceGenerator raceGenerator,
            IAdjustmentsSelector adjustmentsSelector, IRandomizerVerifier randomizerVerifier, IPercentileSelector percentileSelector,
            IAbilitiesGenerator abilitiesGenerator, ICombatGenerator combatGenerator, IEquipmentGenerator equipmentGenerator,
            IMagicGenerator magicGenerator, Generator generator, ICollectionsSelector collectionsSelector)
        {
            this.alignmentGenerator = alignmentGenerator;
            this.characterClassGenerator = characterClassGenerator;
            this.raceGenerator = raceGenerator;
            this.abilitiesGenerator = abilitiesGenerator;
            this.combatGenerator = combatGenerator;
            this.equipmentGenerator = equipmentGenerator;
            this.generator = generator;

            this.adjustmentsSelector = adjustmentsSelector;
            this.randomizerVerifier = randomizerVerifier;
            this.percentileSelector = percentileSelector;
            this.magicGenerator = magicGenerator;
            this.collectionsSelector = collectionsSelector;
        }
Exemplo n.º 2
0
        public void Setup()
        {
            mockCollectionsSelector = new Mock<ICollectionsSelector>();
            mockAdjustmentsSelector = new Mock<IAdjustmentsSelector>();
            mockBooleanPercentileSelector = new Mock<IBooleanPercentileSelector>();
            mockDice = new Mock<Dice>();
            raceGenerator = new RaceGenerator(mockBooleanPercentileSelector.Object, mockCollectionsSelector.Object, mockAdjustmentsSelector.Object, mockDice.Object);

            mockBaseRaceRandomizer = new Mock<RaceRandomizer>();
            mockMetaraceRandomizer = new Mock<RaceRandomizer>();
            characterClass = new CharacterClass();
            alignment = new Alignment();
            speeds = new Dictionary<string, int>();
            intuitiveClasses = new List<string>();
            trainedClasses = new List<string>();

            characterClass.Name = "class name";
            characterClass.Level = 36;
            alignment.Goodness = "goodness";
            speeds[BaseRace] = 9266;

            SetUpTablesForBaseRace(BaseRace);

            var endRoll = new Mock<PartialRoll>();
            endRoll.Setup(r => r.AsSum()).Returns(5);

            var mockPartial = new Mock<PartialRoll>();
            mockPartial.Setup(r => r.d(It.IsAny<int>())).Returns(endRoll.Object);
            mockDice.Setup(d => d.Roll(characterClass.Level)).Returns(mockPartial.Object);

            SetUpRoll("42d600", 14);
            SetUpRoll("420d6000", 24);
            SetUpRoll("4200d60000", 34);
            SetUpRoll("10d4", 104);
            SetUpRoll("92d66", 424);

            mockAdjustmentsSelector.Setup(s => s.SelectFrom(TableNameConstants.Set.Adjustments.LandSpeeds)).Returns(speeds);
            mockBaseRaceRandomizer.Setup(r => r.Randomize(alignment, characterClass)).Returns(BaseRace);
            mockMetaraceRandomizer.Setup(r => r.Randomize(alignment, characterClass)).Returns(Metarace);
            mockCollectionsSelector.Setup(s => s.SelectFrom(TableNameConstants.Set.Collection.ClassNameGroups, CharacterClassConstants.TrainingTypes.Intuitive))
                .Returns(intuitiveClasses);
            mockCollectionsSelector.Setup(s => s.SelectFrom(TableNameConstants.Set.Collection.ClassNameGroups, CharacterClassConstants.TrainingTypes.Trained))
                .Returns(trainedClasses);
        }