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?"); }
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; }
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>()); }
private static Retrospective GetRetrospectiveInStage(RetrospectiveStage retrospectiveStage) { return(new Retrospective { CurrentStage = retrospectiveStage }); }