Пример #1
0
        /// <summary>
        /// Can throw ArgumentExeption in case of negative validation
        /// </summary>
        /// <param name="skillTypeValues">Values for SkillType identification. Must be unique</param>
        /// <param name="knowledgeScaleSteps">Knowledge grab step values. Internal values ​​cannot equal 0</param>
        /// <returns>Rating calculation algorithm</returns>
        public ScoreAlghorythm GetScoreAlghorythm(SkillTypeValues skillTypeValues,
                                                  KnowledgeScaleSteps knowledgeScaleSteps)
        {
            var splitterValidationResult           = _splittedValidator.Validate(skillTypeValues);
            var knowledgeScaleStepValidationResult = _knowledgeValidatior.Validate(knowledgeScaleSteps);

            if (splitterValidationResult.IsValid && knowledgeScaleStepValidationResult.IsValid)
            {
                var skillSplitter = new SkillSplitter(skillTypeValues);
                var skillMatcher  = new SkillsMatcher();
                var ratingCounter = new RatingCounter(knowledgeScaleSteps);

                return(new ScoreAlghorythm(skillSplitter, ratingCounter, skillMatcher));
            }

            throw new ArgumentException($"Arguments is not valid");
        }
Пример #2
0
 internal ScoreAlghorythm(SkillSplitter skillSplitter, RatingCounter ratingCounter, SkillsMatcher skillsMatcher)
 {
     _skillSplitter = skillSplitter;
     _ratingCounter = ratingCounter;
     _skillsMatcher = skillsMatcher;
 }