Exemple #1
0
 public RatingCounter(KnowledgeScaleSteps knowledgeScaleSteps)
 {
     _softKnowledgeScaleStep     = knowledgeScaleSteps.SoftKnowledgeScaleStep;
     _hardKnowledgeScaleStep     = knowledgeScaleSteps.HardKnowledgeScaleStep;
     _languageKnowledgeScaleStep = knowledgeScaleSteps.LanguageKnowledgeScaleStep;
     _qualificationScaleStep     = knowledgeScaleSteps.QualificationScaleStep;
 }
 private void ConfigKnowledgeScaleStep()
 {
     _knowledgeScaleSteps = new KnowledgeScaleSteps()
     {
         HardKnowledgeScaleStep     = HARD_SKILLS_SCALE_STEP,
         LanguageKnowledgeScaleStep = LANG_SKILLS_SCALE_STEP,
         QualificationScaleStep     = QUALIFICATION_SCALE_STEP,
         SoftKnowledgeScaleStep     = SOFT_SKILLS_SCALE_STEP
     };
 }
Exemple #3
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");
        }
        private void ConfigScoreAlghorythm()
        {
            SkillTypeValues skillTypeValues = new SkillTypeValues()
            {
                HardSkillsValue     = HARD_SKILLS_SKILL_TYPE,
                LanguageSkillsValue = LANGUAGE_SKILLS_SKILL_TYPE,
                SoftSkillsValue     = SOFT_SKILLS_SKILL_TYPE
            };
            KnowledgeScaleSteps knowledgeScaleSteps = new KnowledgeScaleSteps()
            {
                HardKnowledgeScaleStep     = HARD_SKILLS_SCALE_STEP,
                LanguageKnowledgeScaleStep = LANG_SKILLS_SCALE_STEP,
                QualificationScaleStep     = QUALIFICATION_SCALE_STEP,
                SoftKnowledgeScaleStep     = SOFT_SKILLS_SCALE_STEP
            };

            Alghorythm = AlghorythmBuilder.GetScoreAlghorythm(skillTypeValues, knowledgeScaleSteps);
        }
        public void InvalidSkillTypeThrowExeptionGetScoreAlghorythmTest(int hardSkillValue, int langSkillValue, int softSkillValue)
        {
            SkillTypeValues skillTypeValues = new SkillTypeValues()
            {
                HardSkillsValue     = hardSkillValue,
                LanguageSkillsValue = langSkillValue,
                SoftSkillsValue     = softSkillValue
            };
            KnowledgeScaleSteps knowledgeScaleSteps = new KnowledgeScaleSteps()
            {
                HardKnowledgeScaleStep     = 6,
                LanguageKnowledgeScaleStep = 6,
                QualificationScaleStep     = 6,
                SoftKnowledgeScaleStep     = 6
            };

            //Assert & Act
            Assert.Throws <ArgumentException>(() => _alghorythmBuilder.GetScoreAlghorythm(skillTypeValues, knowledgeScaleSteps));
        }
        public void InvalidKnowledgeScaleStepGetScoreAlghorythmTest(int hardKnowledgeScaleStep,
                                                                    int languageKnowledgeScaleStep, int qualificationScaleStep, int softKnowledgeScaleStep)
        {
            //Arrange
            SkillTypeValues skillTypeValues = new SkillTypeValues()
            {
                HardSkillsValue     = 1,
                LanguageSkillsValue = 2,
                SoftSkillsValue     = 3
            };
            KnowledgeScaleSteps knowledgeScaleSteps = new KnowledgeScaleSteps()
            {
                HardKnowledgeScaleStep     = hardKnowledgeScaleStep,
                LanguageKnowledgeScaleStep = languageKnowledgeScaleStep,
                QualificationScaleStep     = qualificationScaleStep,
                SoftKnowledgeScaleStep     = softKnowledgeScaleStep
            };

            //Assert & Act
            Assert.Throws <ArgumentException>(() => _alghorythmBuilder.GetScoreAlghorythm(skillTypeValues, knowledgeScaleSteps));
        }
        public void GetScoreAlghorythmTest()
        {
            //Arrange
            ScoreAlghorythm alghorythm;
            SkillTypeValues skillTypeValues = new SkillTypeValues()
            {
                HardSkillsValue     = 1,
                LanguageSkillsValue = 2,
                SoftSkillsValue     = 3
            };
            KnowledgeScaleSteps knowledgeScaleSteps = new KnowledgeScaleSteps()
            {
                HardKnowledgeScaleStep     = 6,
                LanguageKnowledgeScaleStep = 6,
                QualificationScaleStep     = 6,
                SoftKnowledgeScaleStep     = 6
            };

            //Act
            alghorythm = _alghorythmBuilder.GetScoreAlghorythm(skillTypeValues, knowledgeScaleSteps);

            //Assert
            Assert.True(alghorythm != null);
        }