Files
eShopOnWeb/tests/FunctionalTests/Web/Controllers/CatalogControllerIndex.cs
Steve Smith fa8839e1d8 Minor 3.x Updates (#339)
* remove unnecessary call

* Refactoring test fixture
2019-12-18 16:59:25 -05:00

30 lines
824 B
C#

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