/// <inheritdoc /> public Action <IApplicationBuilder> Configure(Action <IApplicationBuilder> next) { Ensure.IsNotNull(next, nameof(next)); var context = new ModuleInitialisationContext(_serviceProvider); foreach (var module in _moduleProvider.Modules) { module.Initialise(context); } return(next); }
public void Configure_ExecutesModuleInitialisation() { // Arrange ModuleInitialisationContext capturedContext = null; var serviceProvider = Mock.Of <IServiceProvider>(); var filter = new ModuleInitialiserStartupFilter( serviceProvider, CreateModuleProvider( CreateModule(mic => capturedContext = mic))); Action <IApplicationBuilder> configure = _ => { }; // Act filter.Configure(configure); // Assert Assert.NotNull(capturedContext); Assert.Same(serviceProvider, capturedContext.ApplicationServices); }
/// <inheritdoc /> public virtual void Initialise(ModuleInitialisationContext context) { }