コード例 #1
0
        public void HighLevelSuite()
        {
            NUnit.Core.TestSuite mockTest = (NUnit.Core.TestSuite)TestFinder.Find("MockTestFixture", testSuite, true);
            SimpleNameFilter     filter   = new SimpleNameFilter("NUnit.Tests.Assemblies.MockTestFixture");

            Assert.AreEqual(true, filter.Pass(mock3), "test case");
            Assert.AreEqual(true, filter.Pass(mockTest), "fixture");
            Assert.AreEqual(true, filter.Pass(testSuite), "test suite");
        }
コード例 #2
0
        public void ExplicitTestSuiteDoesNotMatchWhenNotSelectedDirectly()
        {
            NUnit.Core.TestSuite mockTest = (NUnit.Core.TestSuite)TestFinder.Find("MockTestFixture", testSuite, true);
            mockTest.RunState = RunState.Explicit;
            SimpleNameFilter filter = new SimpleNameFilter("Mock Test Suite");

            Assert.AreEqual(false, filter.Pass(mock3), "descendant of explicit suite should not match");
            Assert.AreEqual(false, filter.Pass(mockTest), "explicit suite should not match");
        }
コード例 #3
0
        public void SuiteNameMatch()
        {
            NUnit.Core.TestSuite mockTest = (NUnit.Core.TestSuite)TestFinder.Find("MockTestFixture", testSuite, true);
            SimpleNameFilter     filter   = new SimpleNameFilter("NUnit.Tests.Assemblies.MockTestFixture");

            Assert.IsTrue(filter.Pass(mock3), "Name Filter did not pass test case");
            Assert.IsTrue(filter.Pass(mockTest), "Fixture did not pass test case");
            Assert.IsTrue(filter.Pass(testSuite), "Suite did not pass test case");
        }
コード例 #4
0
ファイル: NameFilterTest.cs プロジェクト: wsgan001/asegrp
        public void HighLevelSuite()
        {
            NUnit.Core.TestSuite mockTest = (NUnit.Core.TestSuite)TestFinder.Find("MockTestFixture", testSuite);
            NameFilter           filter   = new NameFilter(testSuite.TestName);

            Assert.AreEqual(true, filter.Pass(mock3), "test case");
            Assert.AreEqual(true, filter.Pass(mockTest), "middle suite");
            Assert.AreEqual(true, filter.Pass(testSuite), "test suite");
        }
コード例 #5
0
ファイル: NameFilterTest.cs プロジェクト: wsgan001/asegrp
        public void SuiteNameMatch()
        {
            NUnit.Core.TestSuite mockTest = (NUnit.Core.TestSuite)TestFinder.Find("MockTestFixture", testSuite);
            NameFilter           filter   = new NameFilter(mockTest.TestName);

            Assert.IsTrue(filter.Pass(mock3), "Name Filter did not pass test case");
            Assert.IsTrue(filter.Pass(mockTest), "Suite did not pass test case");
            Assert.IsTrue(filter.Pass(testSuite), "Suite did not pass test case");
        }
コード例 #6
0
        public void ExplicitTestSuiteMatchesWhenSelectedDirectly()
        {
            NUnit.Core.TestSuite mockTest = (NUnit.Core.TestSuite)TestFinder.Find("MockTestFixture", testSuite, true);
            mockTest.RunState = RunState.Explicit;
            SimpleNameFilter filter = new SimpleNameFilter("NUnit.Tests.Assemblies.MockTestFixture");

            Assert.AreEqual(true, filter.Pass(mock3), "test case");
            Assert.AreEqual(true, filter.Pass(mockTest), "middle suite");
            Assert.AreEqual(true, filter.Pass(testSuite), "test suite");
        }
コード例 #7
0
        public void MultipleSuiteNameMatch()
        {
            testSuite.Add(TestBuilder.MakeFixture(typeof(OneTestCase)));
            NUnit.Core.TestSuite mockTestFixture    = (NUnit.Core.TestSuite)TestFinder.Find("MockTestFixture", testSuite, true);
            NUnit.Core.TestSuite oneTestCaseFixture = (NUnit.Core.TestSuite)TestFinder.Find("OneTestCase", testSuite, true);
            SimpleNameFilter     filter             = new SimpleNameFilter("NUnit.Tests.Assemblies.MockTestFixture,NUnit.Tests.Singletons.OneTestCase");

            Assert.IsTrue(filter.Pass(mock3), "Name Filter did not pass test case");
            Assert.IsTrue(filter.Pass(mockTestFixture), "Fixture did not pass test case");
            Assert.IsTrue(filter.Pass(oneTestCaseFixture), "Fixture did not pass test case");
            Assert.IsTrue(filter.Pass(testSuite), "Suite did not pass test case");
        }
コード例 #8
0
        public override void Finish()
        {
            var nunitNamespaceTreeBuilder = new NUnit.Core.NamespaceTreeBuilder(new NUnit.Core.TestSuite(assembly.Name));

            foreach (var nunitFixture in nunitFixtures)
            {
                nunitNamespaceTreeBuilder.Add(nunitFixture);
            }
            NUnit.Core.TestSuite nunitRootSuite = nunitNamespaceTreeBuilder.RootSuite;

            var assemblyTest = new NUnitTest(assembly.Name, assembly, nunitRootSuite);

            PopulateMetadata(assemblyTest);
            PopulateAssemblyTestMetadata(assemblyTest, assembly);
            testModel.RootTest.AddChild(assemblyTest);

            BuildTestChildren(assembly, assemblyTest, nunitRootSuite);
        }