Consolidate Web and WebRazorPages Projects (#192)
* Moved Privacy, Home page to Razor Pages * Migrating Basket from RazorPages to Web. * Removed BasketController; refactored viewmodels * Moved BasketComponent into Pages/Shared Added auth rules to Startup for Pages Added notes to controllers about Pages usage. * Fixed broken my orders test Consolidated Functional Tests * Fixed logo link to home page Fixed Order Detail Total $ format
This commit is contained in:
@@ -22,7 +22,7 @@ namespace Microsoft.eShopWeb.FunctionalTests.Web.Controllers
|
||||
[Fact]
|
||||
public async Task ReturnsRedirectGivenAnonymousUser()
|
||||
{
|
||||
var response = await Client.GetAsync("/Order/Index");
|
||||
var response = await Client.GetAsync("/order/my-orders");
|
||||
var redirectLocation = response.Headers.Location.OriginalString;
|
||||
|
||||
Assert.Equal(HttpStatusCode.Redirect, response.StatusCode);
|
||||
|
||||
30
tests/FunctionalTests/Web/Pages/HomePageOnGet.cs
Normal file
30
tests/FunctionalTests/Web/Pages/HomePageOnGet.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using Microsoft.eShopWeb.FunctionalTests.Web.Controllers;
|
||||
using Microsoft.eShopWeb.Web;
|
||||
using System.Net.Http;
|
||||
using System.Threading.Tasks;
|
||||
using Xunit;
|
||||
|
||||
namespace Microsoft.eShopWeb.FunctionalTests.WebRazorPages
|
||||
{
|
||||
public class HomePageOnGet : IClassFixture<CustomWebApplicationFactory<Startup>>
|
||||
{
|
||||
public HomePageOnGet(CustomWebApplicationFactory<Startup> 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user