Exemplo n.º 1
0
        static public void RegisterAsyncTestExecutor(ITestRunner testRunner, IAsyncTestExecutor newAsyncTestExecutor)
        {
            AsyncTestRunner asyncTestRunner = testRunner as AsyncTestRunner;

            if (asyncTestRunner != null)
            {
                asyncTestRunner.RegisterAsyncTestExecutor(newAsyncTestExecutor);
            }
        }
Exemplo n.º 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);
        }
Exemplo n.º 3
0
        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);
        }