public void Setup()
        {
            mockTypeAndAmountSelector = new Mock <ITypeAndAmountSelector>();
            mockPercentileSelector    = new Mock <IPercentileSelector>();
            mockCollectionSelector    = new Mock <ICollectionSelector>();
            advancementSelector       = new AdvancementSelector(mockTypeAndAmountSelector.Object, mockPercentileSelector.Object, mockCollectionSelector.Object);

            typesAndAmounts   = new List <TypeAndAmountSelection>();
            creatureType      = new CreatureType();
            creatureType.Name = "creature type";

            mockTypeAndAmountSelector.Setup(s => s.Select(TableNameConstants.TypeAndAmount.Advancements, "creature")).Returns(typesAndAmounts);

            creatureTypeDivisor        = new TypeAndAmountSelection();
            creatureTypeDivisor.Type   = "creature type";
            creatureTypeDivisor.Amount = 999999999;

            mockTypeAndAmountSelector.Setup(s => s.SelectOne(TableNameConstants.TypeAndAmount.Advancements, "creature type")).Returns(creatureTypeDivisor);

            mockCollectionSelector.Setup(s => s.SelectRandomFrom(It.IsAny <IEnumerable <TypeAndAmountSelection> >()))
            .Returns((IEnumerable <TypeAndAmountSelection> c) => c.First());
        }
Exemplo n.º 2
0
 public CreatureGenerator(IAlignmentGenerator alignmentGenerator,
                          ICreatureVerifier creatureVerifier,
                          ICollectionSelector collectionsSelector,
                          IAbilitiesGenerator abilitiesGenerator,
                          ISkillsGenerator skillsGenerator,
                          IFeatsGenerator featsGenerator,
                          ICreatureDataSelector creatureDataSelector,
                          IHitPointsGenerator hitPointsGenerator,
                          IArmorClassGenerator armorClassGenerator,
                          ISavesGenerator savesGenerator,
                          JustInTimeFactory justInTimeFactory,
                          IAdvancementSelector advancementSelector,
                          IAttacksGenerator attacksGenerator,
                          ISpeedsGenerator speedsGenerator,
                          IEquipmentGenerator equipmentGenerator,
                          IMagicGenerator magicGenerator,
                          ILanguageGenerator languageGenerator)
 {
     this.alignmentGenerator   = alignmentGenerator;
     this.abilitiesGenerator   = abilitiesGenerator;
     this.skillsGenerator      = skillsGenerator;
     this.featsGenerator       = featsGenerator;
     this.creatureVerifier     = creatureVerifier;
     this.collectionsSelector  = collectionsSelector;
     this.creatureDataSelector = creatureDataSelector;
     this.hitPointsGenerator   = hitPointsGenerator;
     this.armorClassGenerator  = armorClassGenerator;
     this.savesGenerator       = savesGenerator;
     this.justInTimeFactory    = justInTimeFactory;
     this.advancementSelector  = advancementSelector;
     this.attacksGenerator     = attacksGenerator;
     this.speedsGenerator      = speedsGenerator;
     this.equipmentGenerator   = equipmentGenerator;
     this.magicGenerator       = magicGenerator;
     this.languageGenerator    = languageGenerator;
 }