public void InitializeContainerBuilder_Does_Not_Throw_Exception_For_DynamicAssemblies() { //ARRANGE var containerBuilder = new RuntimeTestsContainerBuilder(); var dynamicAssembly = Expression.Lambda(Expression.Empty()).Compile().Method.Module.Assembly; //ACT containerBuilder.CreateGlobalContainer(dynamicAssembly); //ASSERT NO EXCEPTION }
public void Should_be_able_to_resolve_from_scenario_container() { // this basically tests the special registration in DefaultDependencyProvider var containerBuilder = new RuntimeTestsContainerBuilder(); var testThreadContainer = containerBuilder.CreateTestThreadContainer(containerBuilder.CreateGlobalContainer(typeof(TestThreadContextTests).Assembly)); var contextManager = CreateContextManager(testThreadContainer); contextManager.InitializeFeatureContext(new FeatureInfo(FeatureLanguage, "", "test feature", null)); contextManager.InitializeScenarioContext(new ScenarioInfo("test scenario", "test_description", null, null)); contextManager.TestThreadContext.Should().NotBeNull(); var testThreadContext = contextManager.FeatureContext.FeatureContainer.Resolve <TestThreadContext>(); var ctxFromScenarioContext = contextManager.ScenarioContext.ScenarioContainer.Resolve <TestThreadContext>(); ctxFromScenarioContext.Should().BeSameAs(contextManager.TestThreadContext); }