示例#1
0
        private void AppendTestConstructorTitle([NotNull] IncludedTestConstructor test)
        {
            XmlElement row  = CreateTableRow();
            XmlElement cell = CreateTableCell(test.Title, 3, test.Obsolete
                                                                                 ? "obsoleteConstructorTitle"
                                                                                 : "constructorTitle");

            row.AppendChild(cell);
            cell.AppendChild(CreateAnchor(test.Key));

            _htmlTable.AppendChild(row);
        }
示例#2
0
        public void IncludeConstructor([NotNull] IncludedTestConstructor testConstructor)
        {
            Assert.ArgumentNotNull(testConstructor, nameof(testConstructor));
            Assert.ArgumentCondition(_testType == testConstructor.TestType,
                                     "Test constructor does not belong to this test class");

            if (_testConstructors.Contains(testConstructor))
            {
                return;
            }

            _testConstructors.Add(testConstructor);
        }
示例#3
0
        public void IncludeTest(Type testType, int constructorIndex)
        {
            var newTestClass = false;
            IncludedTestClass testClass;

            if (!_includedTestClasses.TryGetValue(testType, out testClass))
            {
                testClass = new IncludedTestClass(testType);

                if (!_includeObsolete && testClass.Obsolete)
                {
                    return;
                }

                if (testClass.InternallyUsed)
                {
                    return;
                }

                // this test class is to be added, if the constructor is not obsolete
                newTestClass = true;
            }

            if (testClass.Obsolete)
            {
                return;
            }

            IncludedTestConstructor testConstructor =
                testClass.CreateTestConstructor(constructorIndex);

            if (!_includeObsolete && testConstructor.Obsolete)
            {
                return;
            }

            if (testConstructor.InternallyUsed)
            {
                return;
            }

            testClass.IncludeConstructor(testConstructor);

            if (newTestClass)
            {
                _includedTestClasses.Add(testType, testClass);
            }
        }