예제 #1
0
        public async Task CustomServiceProviderReplacesApplicationServices()
        {
            var    server = new TestServer(TestServer.CreateBuilder().UseStartup <CustomContainerStartup>());
            string result = await server.CreateClient().GetStringAsync("/path");

            Assert.Equal("ApplicationServicesEqual:True", result);
        }
예제 #2
0
        public async Task CanCreateViaStartupType()
        {
            TestServer          server = new TestServer(TestServer.CreateBuilder().UseStartup <TestStartup>());
            HttpResponseMessage result = await server.CreateClient().GetAsync("/");

            Assert.Equal(HttpStatusCode.OK, result.StatusCode);
            Assert.Equal("FoundService:True", await result.Content.ReadAsStringAsync());
        }