public void CreateWebHostBuilderPattern_CanFindWebHostBuilder() { var factory = HostFactoryResolver.ResolveWebHostBuilderFactory <IWebHostBuilder>(typeof(CreateWebHostBuilderPatternTestSite.Program).Assembly); Assert.NotNull(factory); Assert.IsAssignableFrom <IWebHostBuilder>(factory(Array.Empty <string>())); }
public void CreateWebHostBuilderPattern__Invalid_CantFindWebHostBuilder() { var factory = HostFactoryResolver.ResolveWebHostBuilderFactory <IWebHostBuilder>(typeof(CreateWebHostBuilderInvalidSignature.Program).Assembly); Assert.Null(factory); }
public static IWebHostBuilder CreateFromAssemblyEntryPoint(Assembly assembly, string[] args) { var factory = HostFactoryResolver.ResolveWebHostBuilderFactory <IWebHostBuilder>(assembly); return(factory?.Invoke(args)); }