public void AddAssemblies_WithAssemblies_DiscoversMockServiceModuleRegistrar() { var o = new ModuleRegistrarOptions(); o.AddAssemblies(typeof(object).Assembly, this.GetType().Assembly); Assert.Contains(o.ModuleRegistrars, m => m is MockServiceModuleRegistrar); }
/// <summary> /// Initializes a new instance of <see cref="AspModuleRegistrarStartupFilter"/> /// </summary> /// <param name="serviceProvider"> /// The <see cref="IServiceProvider"/> with registered services /// </param> /// <param name="options"> /// The <see cref="ModuleRegistrarOptions"/> /// </param> /// <param name="configuration"> /// The <see cref="IConfiguration"/> of the application /// </param> /// <param name="hostingEnvironment"> /// The <see cref="IHostingEnvironment"/> this application runs in /// </param> public AspModuleRegistrarStartupFilter(IServiceProvider serviceProvider, ModuleRegistrarOptions options, IConfiguration configuration, IHostingEnvironment hostingEnvironment) { _ = serviceProvider ?? throw new ArgumentNullException(nameof(serviceProvider)); this._options = options ?? throw new ArgumentNullException(nameof(options)); this._hostingEnvironment = hostingEnvironment ?? throw new ArgumentNullException(nameof(hostingEnvironment)); this._configuration = configuration ?? throw new ArgumentNullException(nameof(configuration)); }
public void AddAssembly_WithNullAssembly_ThrowsArgumentNullException() { var o = new ModuleRegistrarOptions(); Assert.Throws <ArgumentNullException>(() => o.AddAssembly(null)); }
public void AddAssemblies_WithNoAssembly_DoesNotThrowArgumentNullException() { var o = new ModuleRegistrarOptions(); o.AddAssemblies(); }
public void AddAssembly_WithAssembly_DoesNotThrowArgumentNullException() { var o = new ModuleRegistrarOptions(); o.AddAssembly(this.GetType().Assembly); }