コード例 #1
0
        public void TestTimeoutNotElapsed()
        {
            TimeoutTestCaseFixture fixture = new TimeoutTestCaseFixture();
            TestSuite   suite      = TestBuilder.MakeFixture(fixture);
            TestMethod  testMethod = (TestMethod)TestFinder.Find("TestTimeOutNotElapsed", suite, false);
            ITestResult result     = TestBuilder.RunTest(testMethod, fixture);

            Assert.That(result.ResultState, Is.EqualTo(ResultState.Success));
        }
コード例 #2
0
        public void TestTimeoutElapsed()
        {
            TimeoutTestCaseFixture fixture = new TimeoutTestCaseFixture();
            TestSuite   suite      = TestBuilder.MakeFixture(fixture);
            TestMethod  testMethod = (TestMethod)TestFinder.Find("TestTimeOutElapsed", suite, false);
            ITestResult result     = TestBuilder.RunTest(testMethod, fixture);

            Assert.That(result.ResultState, Is.EqualTo(ResultState.Failure));
            Assert.That(result.Message, Does.Contain("100ms"));
        }
コード例 #3
0
ファイル: TimeoutTests.cs プロジェクト: wbratz/nunit
            public void TestTimeOutTestCaseWithOutElapsed()
            {
                TimeoutTestCaseFixture fixture = new TimeoutTestCaseFixture();
                TestSuite suite = TestBuilder.MakeFixture(fixture);
                ParameterizedMethodSuite methodSuite = (ParameterizedMethodSuite)TestFinder.Find("TestTimeOutTestCase", suite, false);
                ITestResult result = TestBuilder.RunTest(methodSuite, fixture);

                Assert.That(result.ResultState, Is.EqualTo(ResultState.Failure), "Suite result");
                Assert.That(result.Children.ToArray()[0].ResultState, Is.EqualTo(ResultState.Success), "First test");
                Assert.That(result.Children.ToArray()[1].ResultState, Is.EqualTo(ResultState.Failure), "Second test");
            }
コード例 #4
0
        public void TestTimeOutTestCaseWithOutElapsed()
        {
            TimeoutTestCaseFixture fixture = new TimeoutTestCaseFixture();
            TestSuite suite = TestBuilder.MakeFixture(fixture);
            ParameterizedMethodSuite testMethod = (ParameterizedMethodSuite)TestFinder.Find("TestTimeOutTestCase", suite, false);
            ITestResult result = TestBuilder.RunTest(testMethod, fixture);

            Assert.That(result.ResultState, Is.EqualTo(ResultState.Cancelled));
            Assert.That(result.Children[0].ResultState, Is.EqualTo(ResultState.Success));
            Assert.That(result.Children[1].ResultState, Is.EqualTo(ResultState.Failure));
        }