예제 #1
0
        public static ScorableCriterion ConvertFromDto(this ScorableCriterionDto scorableCriterionDto)
        {
            var scorableCriterion = new ScorableCriterion(scorableCriterionDto.Id, ConvertFromDto(scorableCriterionDto.ScoreCriterion));

            scorableCriterion.SetScoreAndComment(scorableCriterionDto.Score, scorableCriterionDto.Comment);
            return(scorableCriterion);
        }
예제 #2
0
        public void AttemptToSetScoreHigherThanScoreMax()
        {
            ScoreRange     scoreRange     = new ScoreRange(0, 100);
            ScoreCriterion scoreCriterion = new ScoreCriterion("This is a description.", scoreRange);

            ScorableCriterion scorableCriterion = new ScorableCriterion(scoreCriterion);

            double score = 101;

            scorableCriterion.SetScoreAndComment(score, "");
        }
예제 #3
0
        public void CreateScorableCriterion()
        {
            ScoreRange     scoreRange     = new ScoreRange(0, 100);
            ScoreCriterion scoreCriterion = new ScoreCriterion("This is a description.", scoreRange);

            ScorableCriterion scorableCriterion = new ScorableCriterion(scoreCriterion);

            double score   = 99;
            string comment = "This is a comment about the score.";

            scorableCriterion.SetScoreAndComment(score, comment);

            Assert.AreEqual(score, scorableCriterion.Score);
            Assert.AreEqual(comment, scorableCriterion.Comment);
        }