/
githubmirror
/
aspnetcore
Обзор
Документация
Войти
/
githubmirror
/
aspnetcore
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/Mvc/test/Mvc.FunctionalTests/RealServerUsingMinimalBackedIntegrationTests.cs
64 строки
2 KB
github-actions[bot]
[test-quarantine] Quarantine RealServerUsingMinimalBackedIntegrationTests.CanResolveServices (#67341)
21 июн 2026, 16:26
Не верифицирован
21 июн 2026, 16:26
71f1f6b
Код
Авторство
О чём код?
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.Net; using System.Net.Http; using System.Net.Http.Headers; using Microsoft.AspNetCore.Hosting.Server; using Microsoft.AspNetCore.InternalTesting; using Microsoft.Extensions.DependencyInjection; namespace Microsoft.AspNetCore.Mvc.FunctionalTests; public class RealServerUsingMinimalBackedIntegrationTests : IClassFixture<KestrelBasedWebApplicationFactoryForMinimal> { public KestrelBasedWebApplicationFactoryForMinimal Factory { get; } public RealServerUsingMinimalBackedIntegrationTests(KestrelBasedWebApplicationFactoryForMinimal factory) { Factory = factory; } [Fact] public async Task RetrievesDataFromRealServer() { // Arrange var expectedMediaType = MediaTypeHeaderValue.Parse("text/plain; charset=utf-8"); // Act var client = Factory.CreateClient(); var response = await client.GetAsync("/"); var responseContent = await response.Content.ReadAsStringAsync(); // Assert Assert.Equal(HttpStatusCode.OK, response.StatusCode); Assert.Equal(expectedMediaType, response.Content.Headers.ContentType); Assert.Contains("Hello World", responseContent); } [Fact] public async Task ServerReachableViaGenericHttpClient() { // Act using var factoryClient = Factory.CreateClient(); using var client = new HttpClient() { BaseAddress = factoryClient.BaseAddress }; using var response = await client.GetAsync("/"); // Assert Assert.Equal(HttpStatusCode.OK, response.StatusCode); } [Fact] [QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/67340")] public void CanResolveServices() { // Act var server = Factory.Services.GetRequiredService<IServer>(); // Assert Assert.NotNull(server); Assert.Contains("Kestrel", server.GetType().FullName); } }