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); }
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); }
private static void SetupAsyncContext() { fakeAsyncTestExecutor = new FakeAsyncTestExecutor(); ScenarioContext.Current.Set <IAsyncTestExecutor>(fakeAsyncTestExecutor); }
private static void SetupAsyncContext() { fakeAsyncTestExecutor = new FakeAsyncTestExecutor(); ScenarioContext.Current.Set<IAsyncTestExecutor>(fakeAsyncTestExecutor); }