示例#1
0
        protected override Task When()
        {
            _expectedStartup = new MockStartup();

            _xamarinHostBuilder.UsePlatform <MockPlatform>()
            .UseApplication <MockXamarinApplication>()
            .UseStartup(_expectedStartup);

            return(Task.CompletedTask);
        }
示例#2
0
        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);
        }