コード例 #1
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);
        }
コード例 #2
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);
        }
コード例 #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);
        }
コード例 #4
0
ファイル: AsyncContextTest.cs プロジェクト: yazide/SpecFlow
 private static void SetupAsyncContext()
 {
     fakeAsyncTestExecutor = new FakeAsyncTestExecutor();
     ScenarioContext.Current.Set <IAsyncTestExecutor>(fakeAsyncTestExecutor);
 }
コード例 #5
0
ファイル: AsyncContextTest.cs プロジェクト: roffster/SpecFlow
 private static void SetupAsyncContext()
 {
     fakeAsyncTestExecutor = new FakeAsyncTestExecutor();
     ScenarioContext.Current.Set<IAsyncTestExecutor>(fakeAsyncTestExecutor);
 }