Exemple #1
0
        public static TaskScoreQuery Create(int taskId, string userId)
        {
            Fail.If(taskId <= 0);
            Fail.IfNullOrEmpty(userId);

            return(new TaskScoreQuery(taskId, userId));
        }
Exemple #2
0
        public static TestResultsQuery Create(int testId, int solutionId)
        {
            Fail.If(testId <= 0);
            Fail.If(solutionId <= 0);

            return(new TestResultsQuery(testId, solutionId));
        }
Exemple #3
0
        public void If_GivenFalse_NoExceptionThrown()
        {
            Action act = () => Fail.If(false);

            act.Should().NotThrow();
        }
Exemple #4
0
        public void If_GivenTrue_ThrowDesignByContractException()
        {
            Action act = () => Fail.If(true);

            act.Should().Throw <DesignByContractException>();
        }
Exemple #5
0
        public static ContestEndCommand Create(int contestId)
        {
            Fail.If(contestId <= 0);

            return(new ContestEndCommand(contestId));
        }
        public static ContestsUsersQuery Create(int contestId)
        {
            Fail.If(contestId <= 0);

            return(new ContestsUsersQuery(contestId));
        }
Exemple #7
0
        public static ChangeScoreCommand Create(int solutionId, int score)
        {
            Fail.If(solutionId <= 0);

            return(new ChangeScoreCommand(solutionId, score));
        }