public void BuildCallbacksInvokedWhenRegisteredInModuleLoadFromScope() { var module = new BuildCallbackModule(); var builder = new ContainerBuilder(); builder.Build().BeginLifetimeScope(cfg => cfg.RegisterModule(module)); Assert.Equal(2, module.Called); }
public void BuildCallbacksInvokedWhenRegisteredInModuleLoad() { var module = new BuildCallbackModule(); var builder = new ContainerBuilder(); builder.RegisterModule(module); builder.Build(); Assert.Equal(2, module.Called); }
public void BuildCallbacksInvokedWhenModuleAndNormalRegistered() { var module = new BuildCallbackModule(); var called = 0; var builder = new ContainerBuilder(); builder.RegisterBuildCallback(scope => called++); builder.RegisterModule(module); builder.Build(); Assert.Equal(2, module.Called); Assert.Equal(1, called); }