protected override void establish_context() { options = dependency <IReportOptions>(); observation_specification = dependency <IObservationSpecification>(); concern_factory = dependency <IConcernFactory>(); specific_concern = dependency <IConcern>(); }
public Report(IReportOptions options, IEnviornmentVariables enviornmentVariables, ISourceCode sourceCode, ICoverage coverage) { _reportOptions = new Lazy <IReportOptions>(() => options); EnviornmentVariables = enviornmentVariables; SourceCode = sourceCode; Coverage = coverage; _reporter = new Lazy <string>(() => $"{Env}{Network}{CombinedCoverage}"); }
private string build_report_header_block_using(IConcernReport report, IReportOptions options) { if (!string.IsNullOrWhiteSpace(options.custom_header)) { return(string.Format("<h1>{0}</h1>", options.custom_header)); } return(string.Format("<h1>Concerns: {0} - Observations: {1}</h1>", report.total_number_of_concerns, report.total_number_of_observations)); }
private string build_report_header_block_using(IConcernReport report, IReportOptions options) { if (!string.IsNullOrWhiteSpace(options.custom_header)) { return(string.Format("## {0}{1}", options.custom_header, Environment.NewLine)); } return(string.Format("## Scenarios: {0} - Observations: {1}{2}", report.total_number_of_concerns, report.total_number_of_observations, Environment.NewLine)); }
private string build_report_output_using(IConcernReport report, IReportOptions options) { var builder = new StringBuilder(); builder.Append(build_report_header_block_using(report, options)); report.groups.OrderBy(x => x.concerned_with.Name).each(rg => builder.Append(build_behaviour_block_using(rg))); return(builder.ToString()); }
protected override void establish_context() { concern_group_repository = dependency <IConcernGroupRepository>(); concern_groups = new List <IConcernGroup>(); options = dependency <IReportOptions>(); assembly = Assembly.GetExecutingAssembly(); sut = new ConcernReportFactory(concern_group_repository); }
public IEnumerable <IConcernGroup> all_concern_groups_found_using(IReportOptions options) { return(options.assembly_to_scan .all_types_with_a_concern_attribute() .Select(x => concern_factory.create_concern_from(x, options.observation_specification)) .GroupBy(x => x.concerned_with) .Select(x => new ConcernGroup(x)) .Cast <IConcernGroup>()); }
protected override void establish_context() { report_options = new ReportOptions(); report_options_factory = dependency <IReportOptionsFactory>(); concern_report_factory = dependency <IConcernReportFactory>(); report_writer = dependency <IReportWriter>(); builder = new StringBuilder(); writer = new StringWriter(builder); report = dependency <IConcernReport>(); }
public IEnumerable<IStoryReport> all_concern_groups_found_using(IReportOptions options, IObservationReport observations) { var concerns = options.assembly_to_scan .all_types_with_a_concern_attribute() .Select(x => concern_factory.create_concern_from(x, options.observation_specification,observations)) .Cast<IConcern>(); var stories = concerns .GroupBy(x => x.story_key) .Select(x=> StoryFactory.create_from_concerns(x)) .Cast<IStoryReport>(); return stories; }
public IConcernReport create_using(IReportOptions options) { return(new ConcernReport(concern_group_repository.all_concern_groups_found_using(options))); }
public IConcernReport create_using(IReportOptions options, IObservationReport observations) { return new ConcernReport(StoryRepository.all_concern_groups_found_using(options,observations)); }
protected override void because() { result = sut.create_from(args); }
public void save(IConcernReport report, IReportOptions options) { File.WriteAllText(options.output_filename, build_report_output_using(report, options)); }
public IObservationReport create_using(IReportOptions report_options) { return new ObservationReport(repository.all_observations(report_options.mbunit_test_report)); }
private void write_report_using(IReportOptions report_options) { report_writer.save(concern_report_factory.create_using(report_options), report_options); }
private void write_report_using(IReportOptions report_options) { report_writer.save(concern_report_factory.create_using(report_options,test_report_factory.create_using(report_options)), report_options.output_filename); }