示例#1
0
        private XmlElement GetTestDescriptionTextRow(IncludedTestBase test)
        {
            string     testDescription = test.Description;
            XmlElement descriptionRow  = CreateTableRow();

            descriptionRow.AppendChild(CreateTableCell("Description:"));
            descriptionRow.AppendChild(CreateTableCell(testDescription ?? "<no description>", 2));
            return(descriptionRow);
        }
示例#2
0
        private static void AddTestToCategory(
            [NotNull] IncludedTestBase test,
            [NotNull] string category,
            [NotNull] IDictionary <string, List <IncludedTestBase> > categories)
        {
            List <IncludedTestBase> tests;

            if (!categories.TryGetValue(category, out tests))
            {
                tests = new List <IncludedTestBase>();
                categories.Add(category, tests);
            }

            tests.Add(test);
        }
示例#3
0
        private void AppendTestClassDescription(IncludedTestBase test)
        {
            if (test.Description != null)
            {
                AppendTestDescriptionText(test);
            }

            XmlElement categoryRow = CreateTableRow();

            categoryRow.AppendChild(CreateTableCell("Categories:"));
            categoryRow.AppendChild(CreateTableCell(test.GetCommaSeparatedCategories(), 2));

            _htmlTable.AppendChild(categoryRow);

            if (_includeAssemblyInfo)
            {
                var implementationPattern = "";

                if (test is IncludedTestClass)
                {
                    implementationPattern = "Test class";
                }
                else if (test is IncludedTestFactory)
                {
                    implementationPattern = "Test factory";
                }

                string assemblyInfo = string.Format(
                    "{2} {1} in {0}",
                    Path.GetFileName(test.Assembly.Location),
                    test.TestType.FullName,
                    implementationPattern);
                XmlElement assemblyRow = CreateTableRow();
                assemblyRow.AppendChild(CreateTableCell("Implementation:"));
                assemblyRow.AppendChild(CreateTableCell(assemblyInfo, 2));
                _htmlTable.AppendChild(assemblyRow);
            }

            if (test is IncludedTestFactory)
            {
                _htmlTable.AppendChild(
                    GetSignatureRow(((IncludedTest)test).TestFactory));
            }

            AppendTestIssueCodes(test.IssueCodes);
        }
示例#4
0
 private void AppendTestDescriptionText(IncludedTestBase test)
 {
     _htmlTable.AppendChild(GetTestDescriptionTextRow(test));
 }
示例#5
0
        public TestIndexEntry([NotNull] IncludedTestBase includedTest)
        {
            Assert.ArgumentNotNull(includedTest, nameof(includedTest));

            _includedTest = includedTest;
        }