private IWorkflowStep BuildAndRegisterWorkflowStep(bool isRequired = true) { var step = Substitute.For <IWorkflowStep>(); step.NavigationUri.Returns(_fixture.Create <string>()); step.IsStepRequired(Arg.Any <Job>()).Returns(isRequired); var viewModel = Substitute.For <IWorkflowViewModel>(); _workflowNavigationHelper.GetValidatedViewModel(Arg.Any <IRegion>(), step.NavigationUri).Returns(viewModel); _viewModelMapping[step] = viewModel; return(step); }
public async Task Run() { var region = _regionManager.Regions[PrintJobRegionNames.PrintJobMainRegion]; foreach (var step in _steps) { if (Cancel) { return; } if (!step.IsStepRequired(Job)) { continue; } region.RequestNavigate(step.NavigationUri); var viewModel = _workflowNavigationHelper.GetValidatedViewModel(region, step.NavigationUri); await step.ExecuteStep(Job, viewModel); } }