Exemplo n.º 1
0
 private void AssertIsNotAuthorized(string azureUniqueId)
 {
     _authService.LoginUser(azureUniqueId);
     Assert.Throws <UnauthorizedAccessException>(() =>
                                                 EditAction(
                                                     actionId: _action.Id,
                                                     assignedToId: Randomize.Value <Participant>(_evaluation.Participants).Id
                                                     )
                                                 );
 }
Exemplo n.º 2
0
        /* Helper methods */

        private void AssertCanCreate(Participant user)
        {
            _authService.LoginUser(user);
            int answers = NumberOfActions(_question);

            CreateAction(
                questionId: _question.Id,
                assignedToId: Randomize.Value <Participant>(_evaluation.Participants).Id
                );
            Assert.True(NumberOfActions(_question) == answers + 1);
        }
Exemplo n.º 3
0
        /* Helper methods */

        private void AssertCanVoid(Participant user)
        {
            var toDelete = CreateAction(
                questionId: _question.Id,
                assignedToId: Randomize.Value <Participant>(_evaluation.Participants).Id
                );

            _authService.LoginUser(user);
            int answers = NumberOfActions(_question);

            VoidAction(toDelete.Id);
            Assert.True(NumberOfActions(_question) == answers);
            Assert.True(toDelete.IsVoided);
        }
Exemplo n.º 4
0
        public VoidActionMutation(DatabaseFixture fixture) : base(fixture)
        {
            _evaluation  = CreateEvaluation();
            _facilitator = _evaluation.Participants.First();
            _authService.LoginUser(_facilitator);

            _organizationLead = CreateParticipant(_evaluation, role: Role.OrganizationLead);
            _participant      = CreateParticipant(_evaluation, role: Role.Participant);
            _question         = GetFirstQuestion(_evaluation);
            _action           = CreateAction(
                questionId: _question.Id,
                assignedToId: Randomize.Value <Participant>(_evaluation.Participants).Id
                );
        }
Exemplo n.º 5
0
        /* Helper methods */

        private void AssertCanEdit(Participant user)
        {
            _authService.LoginUser(user);
            int    answers     = NumberOfActions(_question);
            string description = _action.Description;
            string actionId    = _action.Id;

            var action = EditAction(
                actionId: actionId,
                assignedToId: Randomize.Value <Participant>(_evaluation.Participants).Id,
                description: Randomize.String()
                );

            Assert.True(NumberOfActions(_question) == answers);
            Assert.True(actionId == action.Id);
            Assert.False(description == action.Description);
        }