Example #1
0
        static public void RegisterAsyncTestExecutor(ITestRunner testRunner, IAsyncTestExecutor newAsyncTestExecutor)
        {
            AsyncTestRunner asyncTestRunner = testRunner as AsyncTestRunner;

            if (asyncTestRunner != null)
            {
                asyncTestRunner.RegisterAsyncTestExecutor(newAsyncTestExecutor);
            }
        }
Example #2
0
        public void SetUp()
        {
            mockTestRunner = MockRepository.GenerateMock<ITestRunner>();
            fakeAsyncTestExecutor = new FakeAsyncTestExecutor();

            asyncTestRunner = new AsyncTestRunner(mockTestRunner);
            asyncTestRunner.RegisterAsyncTestExecutor(fakeAsyncTestExecutor);
            var scenarioInfo = new ScenarioInfo("sample scenario");
            ObjectContainer.ScenarioContext = new ScenarioContext(scenarioInfo, mockTestRunner);
            asyncTestRunner.OnScenarioStart(scenarioInfo);
        }
        public virtual void SetUp()
        {
            contextManagerStub = new Mock<IContextManager>();
            testExecutionEngineStub = new Mock<ITestExecutionEngine>();
            testExecutionEngineStub.Setup(tr => tr.ScenarioContext).Returns(() => contextManagerStub.Object.ScenarioContext);
            testExecutionEngineStub.Setup(tr => tr.FeatureContext).Returns(() => contextManagerStub.Object.FeatureContext);
            testExecutionEngineStub.Setup(m => m.OnScenarioStart(It.IsAny<ScenarioInfo>())).Callback(
                (ScenarioInfo si) => contextManagerStub.Setup(cm => cm.ScenarioContext).Returns(new ScenarioContext(si, asyncTestRunner, null))
                );
            fakeAsyncTestExecutor = new FakeAsyncTestExecutor();

            asyncTestRunner = new AsyncTestRunner(testExecutionEngineStub.Object);
        }