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() ) ); }
/* 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); }
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); }