示例#1
0
        private ReportStep CloneTo(SpecFlowStep step, string currentBlock, string sampleText)
        {
            ReportStep newStep = null;

            if (currentBlock == "When")
            {
                newStep = new ReportStep(step.Location, step.Keyword, sampleText, ConvertArgument(step.Argument), step.StepKeyword, Parser.ScenarioBlock.When);
            }
            else if (currentBlock == "Then")
            {
                newStep = new ReportStep(step.Location, step.Keyword, sampleText, ConvertArgument(step.Argument), step.StepKeyword, Parser.ScenarioBlock.Then);
            }
            else // Given or empty
            {
                newStep = new ReportStep(step.Location, step.Keyword, sampleText, ConvertArgument(step.Argument), step.StepKeyword, Parser.ScenarioBlock.Given);
            }

            Debug.Assert(newStep != null);

            return(newStep);
        }
 public void SwitchToStep(ReportingStepType set)
 {
     _currentStep = _entries[set];
 }
            public ReportingHelper([NotNull] ImportExportSettings settings, [NotNull] IProgress<ActiveProgress> reporter, [NotNull] Func<ReportingStepType, StepInfo> getAmount)
            {
                if (reporter == null) throw new ArgumentNullException(nameof(reporter));
                _reporter = reporter;

                _entries = new Dictionary<ReportingStepType, ReportStep>();
                var types = new List<ReportingStepType>();

                if(settings.ProcessPlugIns) types.Add(ReportingStepType.Plugins);
                if(settings.ProcessRadios) types.Add(ReportingStepType.Radios);
                if(settings.ProcessScripts) types.Add(ReportingStepType.Scripts);
                if(settings.ProcessSettings) types.Add(ReportingStepType.Settings);

                foreach (var reportingStepType in types)
                {
                    var info = getAmount(reportingStepType);
                    _entries[reportingStepType] = new ReportStep(info);
                    _maximumAmount += info.Amount;
                }
            }