public static ReportModel.Scenario ToScenarioModel(this Scenario scenario)
        {
            if (scenario == null)
                return null;

            var model = new ReportModel.Scenario
            {
                Id = scenario.Id,
                Title = scenario.Title,
                Tags = scenario.Tags,
                Example = scenario.Example != null ? scenario.Example.ToExampleModel() : null,
                Duration = scenario.Duration,
                Result = scenario.Result
            };
            scenario.Steps.ForEach(x => model.Steps.Add(x.ToStepModel()));
            return model;
        }
예제 #2
0
        public static ReportModel.Scenario ToScenarioModel(this Scenario scenario)
        {
            if (scenario == null)
            {
                return(null);
            }

            var model = new ReportModel.Scenario
            {
                Id      = scenario.Id,
                Title   = scenario.Title,
                Tags    = scenario.Tags,
                Example = scenario.Example != null?scenario.Example.ToExampleModel() : null,
                              Duration = scenario.Duration,
                              Result   = scenario.Result
            };

            scenario.Steps.ForEach(x => model.Steps.Add(x.ToStepModel()));
            return(model);
        }