Files
eShopOnWeb/tests/FunctionalTests/Web/Controllers/CatalogControllerIndex.cs
Steve Smith ce63e38a23 net6conversion (#642)
* Converting to net6 startup and integration test formats

* Update to minimal api and using pagetitle

* Adjust functional test fixtures
Update ApiEndpoints package version

* Finish migration to minimal api startup
2021-12-06 15:14:43 -05:00

29 lines
748 B
C#

using System.Net.Http;
using System.Threading.Tasks;
using Xunit;
namespace Microsoft.eShopWeb.FunctionalTests.Web.Controllers;
[Collection("Sequential")]
public class CatalogControllerIndex : IClassFixture<TestApplication>
{
public CatalogControllerIndex(TestApplication 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);
}
}