Beispiel #1
0
 private void AssertIsNotAuthorized(Participant user)
 {
     _authService.LoginUser(user.AzureUniqueId);
     Assert.Throws <UnauthorizedAccessException>(() =>
                                                 _mutation.ProgressParticipant(
                                                     evaluationId: _evaluation.Id,
                                                     newProgression: Randomize.Progression()
                                                     )
                                                 );
 }
 private void AssertIsNotAuthorized(string azureUniqueId)
 {
     _authService.LoginUser(azureUniqueId);
     Assert.Throws <UnauthorizedAccessException>(() =>
                                                 _mutation.ProgressEvaluation(
                                                     evaluationId: _evaluation.Id,
                                                     newProgression: Randomize.Progression()
                                                     )
                                                 );
 }
Beispiel #3
0
        /* Helper methods */

        private void AssertCanProgress(Participant user)
        {
            _authService.LoginUser(user);
            Progression newProgression = Randomize.Progression();

            _mutation.ProgressParticipant(
                evaluationId: _evaluation.Id,
                newProgression: newProgression
                );

            Assert.True(user.Progression == newProgression);
        }
Beispiel #4
0
        protected Answer SetAnswer(
            string questionId,
            Severity?severity       = null,
            string text             = null,
            Progression?progression = null)
        {
            if (text == null)
            {
                text = Randomize.String();
            }

            Answer answer = _mutation.SetAnswer(
                questionId: questionId,
                severity: severity.GetValueOrDefault(Randomize.Severity()),
                text: text,
                progression: progression.GetValueOrDefault(Randomize.Progression())
                );

            return(answer);
        }