public void ThrowAnExceptionWhenStartupHasNotBeenConfigured() { var target = new DefaultRuntimeHostBuilder(); var ex = Assert.Throws <BuildException>(() => target.Build()); Assert.AreEqual("The startup must be configured.", ex.Message); }
public void MustConfigureProcessorsWhenBuilt() { var called = false; var target = new DefaultRuntimeHostBuilder(); target.UseStartup(new StubStartup(_ => called = true)); Assert.IsNotNull(target.Build()); Assert.True(called); }
public void ShouldRunTheCallbackWhenBeingBuilt() { var called = false; var target = new DefaultRuntimeHostBuilder(); target.ConfigureServices(services => { called = true; }); target.UseStartup(new StubStartup()); Assert.IsNotNull(target.Build()); Assert.True(called); }
public void ThrowsAnExceptionWhenStartupInstanceIsNull() { var target = new DefaultRuntimeHostBuilder(); Assert.Throws <ArgumentNullException>(() => target.UseStartup(null)); }
public void ThrowsAnExceptionWhenCallbackIsNull() { var target = new DefaultRuntimeHostBuilder(); Assert.Throws <ArgumentNullException>(() => target.ConfigureServices(null)); }
public void ThrowsAnExceptionWhenTheCallbackIsNullWhileConfiguringThe0Environment() { var target = new DefaultRuntimeHostBuilder(); Assert.Throws <ArgumentNullException>(() => target.ConfigureHostingEnvironment(null)); }