Exemplo n.º 1
0
 private void EnsureRetrospectiveInStage(RetrospectiveStage retrospectiveStage) {
     using IServiceScope scope = this.App.CreateTestServiceScope();
     var dbContext = scope.ServiceProvider.GetRequiredService<IReturnDbContext>();
     Assume.That(() => dbContext.Retrospectives.AsNoTracking().FindByRetroId(this.RetroId, CancellationToken.None).ConfigureAwait(false).GetAwaiter().GetResult(),
         Has.Property(nameof(Retrospective.CurrentStage)).EqualTo(retrospectiveStage).Retry(),
         $"Retrospective {this.RetroId} is not in stage {retrospectiveStage} required for this test. Are the tests running in the correct order?");
 }
Exemplo n.º 2
0
 public RetrospectiveStatus(string retroId, string title, RetrospectiveStage retrospectiveStage, RetrospectiveWorkflowStatus workflowStatus, int votesPerLane)
 {
     this.RetroId        = retroId;
     this.Title          = title;
     this.Stage          = retrospectiveStage;
     this.WorkflowStatus = workflowStatus;
     this.VotesPerLane   = votesPerLane;
 }
Exemplo n.º 3
0
        public void SecurityValidator_DisallowsOperationsOnNote_InStages(RetrospectiveStage stage)
        {
            // Given
            Retrospective retro = GetRetrospectiveInStage(stage);
            var           note  = new Note {
                ParticipantId = 252
            };

            this._currentParticipantService.SetParticipant(new CurrentParticipantModel(252, String.Empty, false));

            // When
            TestDelegate action = () => this._securityValidator.EnsureOperation(retro, SecurityOperation.AddOrUpdate, note).GetAwaiter().GetResult();

            // Then
            Assert.That(action, Throws.InstanceOf <OperationSecurityException>());
        }
Exemplo n.º 4
0
 private static Retrospective GetRetrospectiveInStage(RetrospectiveStage retrospectiveStage)
 {
     return(new Retrospective {
         CurrentStage = retrospectiveStage
     });
 }