Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 4
0
 private void AppendTestDescriptionText(IncludedTestBase test)
 {
     _htmlTable.AppendChild(GetTestDescriptionTextRow(test));
 }
Esempio n. 5
0
        public TestIndexEntry([NotNull] IncludedTestBase includedTest)
        {
            Assert.ArgumentNotNull(includedTest, nameof(includedTest));

            _includedTest = includedTest;
        }