当前位置: 首页>>代码示例>>C#>>正文


C# IReport.Sections方法代码示例

本文整理汇总了C#中IReport.Sections方法的典型用法代码示例。如果您正苦于以下问题:C# IReport.Sections方法的具体用法?C# IReport.Sections怎么用?C# IReport.Sections使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IReport的用法示例。


在下文中一共展示了IReport.Sections方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CreateTestResultHtml

        private static string CreateTestResultHtml(IReport report)
        {
            var hasPassed = true;
            foreach (var section in report.Sections().SelectMany(s => s.Sections()))
            {
                hasPassed = hasPassed && section.WasSuccessful;
                if (!hasPassed)
                {
                    break;
                }
            }

            var template = hasPassed
                ? @"Sherlock.Shared.Core.Reporting.Templates.ReportResultPassedTemplate.html"
                : @"Sherlock.Shared.Core.Reporting.Templates.ReportResultFailedTemplate.html";

            return EmbeddedResourceExtracter.LoadEmbeddedTextFile(Assembly.GetExecutingAssembly(), template);
        }
开发者ID:pvandervelde,项目名称:Sherlock,代码行数:18,代码来源:HtmlReportTransformer.cs

示例2: DetermineTestPassOrFail

        private static string DetermineTestPassOrFail(IReport report)
        {
            var hasPassed = true;
            foreach (var section in report.Sections().SelectMany(s => s.Sections()))
            {
                hasPassed = hasPassed && section.WasSuccessful;
                if (!hasPassed)
                {
                    break;
                }
            }

            return hasPassed ? @"Passed" : @"Failed";
        }
开发者ID:pvandervelde,项目名称:Sherlock,代码行数:14,代码来源:XmlReportTransformer.cs

示例3: CreateReportSectionHtml

        /// <summary>
        /// Creates the HTML that describes a report section.
        /// </summary>
        /// <param name="report">The report that contains the report section information.</param>
        /// <returns>A string containing the desired HTML.</returns>
        private static string CreateReportSectionHtml(IReport report)
        {
            var sortedSections = new List<Tuple<DateTimeOffset, string, TestSection>>();
            foreach (var reportSection in report.Sections())
            {
                foreach (var testSection in reportSection.Sections())
                {
                    sortedSections.Add(new Tuple<DateTimeOffset, string, TestSection>(testSection.StartTime, reportSection.Name, testSection));
                }
            }

            sortedSections.Sort((first, second) => first.Item1.CompareTo(second.Item1));
            var builder = new StringBuilder();
            {
                int section = 0;
                foreach (var pair in sortedSections)
                {
                    var sectionText = CreateTestSectionHtml(pair.Item2, pair.Item3, section % 2 == 0);
                    builder.AppendLine(sectionText);

                    section++;
                }
            }

            return builder.ToString();
        }
开发者ID:pvandervelde,项目名称:Sherlock,代码行数:31,代码来源:HtmlReportTransformer.cs

示例4: CreateReportSectionXml

        /// <summary>
        /// Creates the XML that describes a report section.
        /// </summary>
        /// <param name="report">The report that contains the report section information.</param>
        /// <returns>A string containing the desired XML.</returns>
        private static string CreateReportSectionXml(IReport report)
        {
            var reportSectionTemplate = EmbeddedResourceExtracter.LoadEmbeddedTextFile(
                Assembly.GetExecutingAssembly(),
                @"Sherlock.Shared.Core.Reporting.Templates.ReportSectionTemplate.xml");
            string reportSections = string.Empty;

            foreach (var reportSection in report.Sections())
            {
                var testSections = CreateTestSectionXml(reportSection);
                var builder = new StringBuilder(reportSectionTemplate);
                {
                    builder.Replace(@"${REPORT_SECTION_NAME}$", EscapeTextForUseInXml(reportSection.Name));
                    builder.Replace(@"${TEST_SECTIONS}$", testSections);
                }

                reportSections += builder.ToString();
            }

            return reportSections;
        }
开发者ID:pvandervelde,项目名称:Sherlock,代码行数:26,代码来源:XmlReportTransformer.cs


注:本文中的IReport.Sections方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。