* Updates based on documentation * Getting the build passing * Getting app functioning * A few cleanups to confirm it's working as expected * Fixing functional tests * Updating dockerfile for 3.0 * Functional Tests now run sequentially * Updating to latest version of moq * Adding migration for post 3.0 upgrades * Removing commented out lines * Moving address and catalogitemordered configuration in to classes that own them * Minor cleanups
34 lines
1.0 KiB
C#
34 lines
1.0 KiB
C#
using Microsoft.AspNetCore.Mvc.Testing;
|
|
using Microsoft.eShopWeb.Web;
|
|
using System.Net;
|
|
using System.Net.Http;
|
|
using System.Threading.Tasks;
|
|
using Xunit;
|
|
|
|
namespace Microsoft.eShopWeb.FunctionalTests.Web.Controllers
|
|
{
|
|
[Collection("Sequential")]
|
|
public class OrderIndexOnGet : IClassFixture<CustomWebApplicationFactory<Startup>>
|
|
{
|
|
public OrderIndexOnGet(CustomWebApplicationFactory<Startup> factory)
|
|
{
|
|
Client = factory.CreateClient(new WebApplicationFactoryClientOptions
|
|
{
|
|
AllowAutoRedirect = false
|
|
});
|
|
}
|
|
|
|
public HttpClient Client { get; }
|
|
|
|
[Fact]
|
|
public async Task ReturnsRedirectGivenAnonymousUser()
|
|
{
|
|
var response = await Client.GetAsync("/order/my-orders");
|
|
var redirectLocation = response.Headers.Location.OriginalString;
|
|
|
|
Assert.Equal(HttpStatusCode.Redirect, response.StatusCode);
|
|
Assert.Contains("/Account/Login", redirectLocation);
|
|
}
|
|
}
|
|
}
|