Exemplo n.º 1
0
 public FeatsGenerator(IRacialFeatsGenerator racialFeatsGenerator, IClassFeatsGenerator classFeatsGenerator,
     IAdditionalFeatsGenerator additionalFeatsGenerator, ICollectionsSelector collectionsSelector)
 {
     this.racialFeatsGenerator = racialFeatsGenerator;
     this.classFeatsGenerator = classFeatsGenerator;
     this.additionalFeatsGenerator = additionalFeatsGenerator;
     this.collectionsSelector = collectionsSelector;
 }
        public void Setup()
        {
            mockCollectionsSelector = new Mock<ICollectionsSelector>();
            mockFeatsSelector = new Mock<IFeatsSelector>();
            mockFeatFocusGenerator = new Mock<IFeatFocusGenerator>();
            mockAdjustmentsSelector = new Mock<IAdjustmentsSelector>();
            additionalFeatsGenerator = new AdditionalFeatsGenerator(mockCollectionsSelector.Object, mockFeatsSelector.Object, mockFeatFocusGenerator.Object, mockAdjustmentsSelector.Object);
            characterClass = new CharacterClass();
            race = new Race();
            stats = new Dictionary<string, Stat>();
            skills = new Dictionary<string, Skill>();
            additionalFeatSelections = new List<AdditionalFeatSelection>();
            baseAttack = new BaseAttack();
            stats[StatConstants.Intelligence] = new Stat(StatConstants.Intelligence);
            preselectedFeats = new List<Feat>();
            fighterBonusFeats = new List<string>();
            wizardBonusFeats = new List<string>();
            monsters = new List<string>();

            monsters.Add("monster");

            mockFeatsSelector.Setup(s => s.SelectAdditional()).Returns(additionalFeatSelections);
            mockCollectionsSelector.Setup(s => s.SelectFrom(TableNameConstants.Set.Collection.FeatGroups, GroupConstants.FighterBonusFeats)).Returns(fighterBonusFeats);
            mockCollectionsSelector.Setup(s => s.SelectFrom(TableNameConstants.Set.Collection.FeatGroups, GroupConstants.WizardBonusFeats)).Returns(wizardBonusFeats);
            mockCollectionsSelector.Setup(s => s.SelectRandomFrom(It.IsAny<IEnumerable<AdditionalFeatSelection>>())).Returns((IEnumerable<AdditionalFeatSelection> fs) => fs.First());
            mockCollectionsSelector.Setup(s => s.SelectFrom(TableNameConstants.Set.Collection.BaseRaceGroups, GroupConstants.Monsters)).Returns(monsters);
        }