protected override Task When() { _expectedStartup = new MockStartup(); _xamarinHostBuilder.UsePlatform <MockPlatform>() .UseApplication <MockXamarinApplication>() .UseStartup(_expectedStartup); return(Task.CompletedTask); }
public async Task BrowserHost_StartAsync_RunsConfigureMethod() { // Arrange var builder = new WebAssemblyHostBuilder(); var startup = new MockStartup(); builder.ConfigureServices((c, s) => { s.AddSingleton <IBlazorStartup>(startup); }); var host = builder.Build(); // Act await host.StartAsync(); // Assert Assert.True(startup.ConfigureCalled); }