public void IsJudgedBy_Run1Judge2NotExists() { var j1 = new Judge() { Id = 1 }; var j2 = new Judge() { Id = 2 }; var rc = new RoundContestant() { Id = 3 }; var crit = new JudgingCriterion() { Id = 6 }; rc.EnsureListsAreInitialized(); rc.ReplaceRunJudging(new RunJudging { RoundContestant = rc, RunNo = 1, Score = 3, Judge = j1, Criterion = crit, JudgeId = j1.Id }); var result = rc.IsJudgedBy(j2, 1, 1); Assert.IsFalse(result); }
public void IsJudgedBy_Run1Judge1With2Criteras() { var j1 = new Judge() { Id = 1 }; var rc = new RoundContestant() { Id = 3 }; var crit1 = new JudgingCriterion() { Id = 6 }; var crit2 = new JudgingCriterion() { Id = 7 }; rc.EnsureListsAreInitialized(); rc.ReplaceRunJudging(new RunJudging(rc, j1, crit1, 1, 3.0M)); rc.ReplaceRunJudging(new RunJudging(rc, j1, crit2, 1, 3.0M)); var result = rc.IsJudgedBy(j1, 1, 2); Assert.IsTrue(result); }
internal static List <JudgeHasScoredTuple> GetJudgeStatusListFor(Tournament t, RoundContestant rc, int runNo) { var list = new List <JudgeHasScoredTuple>(); if (rc != null) { int criteriaCount = t.JudgingCriteria.Count; foreach (var judge in t.Judges) { var tuplet = new JudgeHasScoredTuple(); tuplet.JudgeName = judge.Name; tuplet.HasJudged = rc.IsJudgedBy(judge, runNo, criteriaCount); list.Add(tuplet); } } return(list); }