public void RunAndVerifyExecutingStep(ConfigurableProgressEvents progressEvents, IProgressStep currentStep, int?currentVmIndex) { ProgressStepViewModel currentVM = currentVmIndex.HasValue ? this.visualizer.ViewModel.Steps[currentVmIndex.Value] : null; bool isFinalState = ProgressControllerHelper.IsFinalState(currentStep.ExecutionState) && this.IsLastStep(currentStep); // Trigger the event progressEvents.InvokeStepExecutionChanged(new StepExecutionChangedEventArgs(currentStep)); // Assert if (currentVmIndex.HasValue) { VerifyProgress(this.visualizer, this.ExpectedMainProgress, currentVM, this.ExpectedSubProgress); if (isFinalState) { this.testSubject.CurrentExecutingGroup.Should().BeNull("Not expecting any executing group"); } else { IProgressStep[] steps = this.GetAllStepsInGroup(currentStep); if (currentStep.ImpactsProgress) { steps.Should().NotBeNull("There should be at least one step in the group"); VerifyExecutionGroup(this.testSubject.CurrentExecutingGroup, steps); } else { steps.Should().BeNull("Not expecting any steps in group since not impacting, so there's no group for it"); } } } else { currentVM.Should().BeNull("Current VM should be null, since not impacts progress"); (this.testSubject.CurrentExecutingGroup == null || this.testSubject.CurrentExecutingGroup.ExecutingStep == null) .Should().BeTrue("Not expecting any changes for non impacting steps"); } }
public void RunAndVerifyExecutingStep(ConfigurableProgressEvents progressEvents, IProgressStep currentStep, int? currentVmIndex) { ProgressStepViewModel currentVM = currentVmIndex.HasValue ? this.visualizer.ViewModel.Steps[currentVmIndex.Value] : null; bool isFinalState = ProgressControllerHelper.IsFinalState(currentStep.ExecutionState) && this.IsLastStep(currentStep); // Trigger the event progressEvents.InvokeStepExecutionChanged(new StepExecutionChangedEventArgs(currentStep)); // Verify if (currentVmIndex.HasValue) { VerifyProgress(this.visualizer, this.ExpectedMainProgress, currentVM, this.ExpectedSubProgress); if (isFinalState) { Assert.IsNull(this.testSubject.CurrentExecutingGroup, "Not expecting any executing group"); } else { IProgressStep[] steps = this.GetAllStepsInGroup(currentStep); if (currentStep.ImpactsProgress) { Assert.IsNotNull(steps, "There should be at least one step in the group"); VerifyExecutionGroup(this.testSubject.CurrentExecutingGroup, steps); } else { Assert.IsNull(steps, "Not expecting any steps in group since not impacting, so there's no group for it"); } } } else { Assert.IsNull(currentVM, "Current VM should be null, since not impacts progress"); Assert.IsTrue(this.testSubject.CurrentExecutingGroup == null || this.testSubject.CurrentExecutingGroup.ExecutingStep == null, "Not expecting any changes for non impacting steps"); } }