* 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
30 lines
774 B
C#
30 lines
774 B
C#
using System.Net.Http;
|
|
using System.Threading.Tasks;
|
|
using Microsoft.eShopWeb.FunctionalTests.Web;
|
|
using Xunit;
|
|
|
|
namespace Microsoft.eShopWeb.FunctionalTests.WebRazorPages;
|
|
|
|
[Collection("Sequential")]
|
|
public class HomePageOnGet : IClassFixture<TestApplication>
|
|
{
|
|
public HomePageOnGet(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);
|
|
}
|
|
}
|