using System.Net; using Events.Tests.IntegrationTests.Infrastructure; namespace Events.Tests.IntegrationTests; public class PeoplePageShould { [Fact] public async Task ReturnPageWithPeopleListWhenCountryAndPersonExist() { await using var factory = new CustomWebApplicationFactory(TestDataSeeder.SeedPeople); using var client = factory.CreateClient(); var response = await client.GetAsync("/People"); var html = await response.Content.ReadAsStringAsync(); Assert.Equal(HttpStatusCode.OK, response.StatusCode); Assert.Contains("People list", html); Assert.Contains("First name", html); Assert.Contains("Last name", html); Assert.Contains("Ivan Horvat", html); Assert.Contains("Croatia", html); } [Fact] public async Task RenderNativeFullNameAndTranscribedNamesInSeparateColumns() { await using var factory = new CustomWebApplicationFactory(ctx => { ctx.Countries.Add(new Events.EF.Models.Country { Code = "UA", Alpha3 = "UKR", Name = "Ukraine" }); ctx.People.Add(new Events.EF.Models.Person { Id = 1, FirstName = "Олексій", LastName = "Шевченко", FirstNameTranscription = "Oleksii", LastNameTranscription = "Shevchenko", AddressLine = "Khreshchatyk 1", PostalCode = "01001", City = "Kyiv", AddressCountry = "Ukraine", Email = "oleksii.shevchenko@example.com", ContactPhone = "+38050111222", BirthDate = new DateOnly(1991, 6, 1), DocumentNumber = "DOC-1", CountryCode = "UA" }); }); using var client = factory.CreateClient(); var response = await client.GetAsync("/People"); var html = await response.Content.ReadAsStringAsync(); var decodedHtml = WebUtility.HtmlDecode(html); Assert.Equal(HttpStatusCode.OK, response.StatusCode); Assert.Contains("