Exemplo n.º 1
0
        public void AsynchronousTestMayHaveTimeoutSpecified()
        {
            AsynchronousFixture fixture = new AsynchronousFixture();
            ITestResult result = TestBuilder.RunTestCase(fixture, "AsynchronousTestWithTimeout");

            Assert.That(result.ResultState, Is.EqualTo(ResultState.Failure));
            Assert.That(result.Message, Contains.Substring("5ms"));
        }
Exemplo n.º 2
0
        public void AsynchronousTestReturnsBeforeTestIsComplete()
        {
            AsynchronousFixture fixture = new AsynchronousFixture();
            WorkItem wi = TestBuilder.RunTestCaseAsync(fixture, "AsynchronousTest");

            Assert.That(wi.State, Is.Not.EqualTo(WorkItemState.Complete));

            fixture.Quit = true;
            while (wi.State != WorkItemState.Complete)
                Thread.Sleep(2);

            Assert.That(wi.Result.ResultState, Is.EqualTo(ResultState.Success));
        }