using Microsoft.eShopWeb.Web; using System.Net.Http; using System.Threading.Tasks; using Xunit; namespace Microsoft.eShopWeb.FunctionalTests.Web.Controllers { public class CatalogControllerIndex : IClassFixture> { public CatalogControllerIndex(CustomWebApplicationFactory factory) { Client = factory.CreateClient(); } public HttpClient Client { get; } [Fact] public async Task ReturnsHomePageWithProductListing() { // Arrange & Act var response = await Client.GetAsync("/"); response.EnsureSuccessStatusCode(); var stringResponse = await response.Content.ReadAsStringAsync(); // Assert Assert.Contains(".NET Bot Black Sweatshirt", stringResponse); } } }