コード例 #1
0
ファイル: TestSuiteTest.cs プロジェクト: taoxiease/asegrp
        public void CountTestCasesFilteredByName()
        {
            TestSuite testSuite = new TestSuite("Mock Test Suite");
            testSuite.Add(mockTestFixture);
            Assert.AreEqual(MockTestFixture.Tests, testSuite.TestCount);

            NUnit.Core.TestCase mock3 = (NUnit.Core.TestCase) TestFinder.Find("MockTest3", testSuite);
            NUnit.Core.TestCase mock1 = (NUnit.Core.TestCase) TestFinder.Find("MockTest1", testSuite);
            NameFilter filter = new NameFilter(mock3.TestName);
            Assert.AreEqual(1, testSuite.CountTestCases(filter));

            filter = new NameFilter();
            filter.Add(mock3.TestName);
            filter.Add(mock1.TestName);

            Assert.AreEqual(2, testSuite.CountTestCases(filter));

            filter = new NameFilter(testSuite.TestName);

            Assert.AreEqual(MockTestFixture.Tests - MockTestFixture.Explicit, testSuite.CountTestCases(filter));
        }
コード例 #2
0
        public void CountTestCasesFilteredByName()
        {
            TestSuite testSuite = new TestSuite("Mock Test Suite");
            testSuite.Add(mockTestFixture);
            Assert.AreEqual(MockTestFixture.Tests, testSuite.TestCount);

            Test mock3 = TestFinder.Find("MockTest3", testSuite, true);
            Test mock1 = TestFinder.Find("MockTest1", testSuite, true);
            NameFilter filter = new NameFilter(mock3.TestName);
            Assert.AreEqual(1, testSuite.CountTestCases(filter));

            filter = new NameFilter();
            filter.Add(mock3.TestName);
            filter.Add(mock1.TestName);

            Assert.AreEqual(2, testSuite.CountTestCases(filter));

            filter = new NameFilter(testSuite.TestName);

            Assert.AreEqual(MockTestFixture.ResultCount, testSuite.CountTestCases(filter));
        }