Included file scoped namespace
This commit is contained in:
parent
15f5e49134
commit
f53a3e407f
@ -1,16 +1,11 @@
|
|||||||
using Microsoft.AspNetCore.TestHost;
|
namespace FunctionalTests.Extensions;
|
||||||
using System;
|
|
||||||
using System.Net.Http;
|
|
||||||
|
|
||||||
namespace FunctionalTests.Extensions
|
static class HttpClientExtensions
|
||||||
{
|
{
|
||||||
static class HttpClientExtensions
|
|
||||||
{
|
|
||||||
public static HttpClient CreateIdempotentClient(this TestServer server)
|
public static HttpClient CreateIdempotentClient(this TestServer server)
|
||||||
{
|
{
|
||||||
var client = server.CreateClient();
|
var client = server.CreateClient();
|
||||||
client.DefaultRequestHeaders.Add("x-requestid", Guid.NewGuid().ToString());
|
client.DefaultRequestHeaders.Add("x-requestid", Guid.NewGuid().ToString());
|
||||||
return client;
|
return client;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,7 @@
|
|||||||
using Microsoft.AspNetCore.Http;
|
namespace FunctionalTests.Middleware;
|
||||||
using System.Security.Claims;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace FunctionalTests.Middleware
|
class AutoAuthorizeMiddleware
|
||||||
{
|
{
|
||||||
class AutoAuthorizeMiddleware
|
|
||||||
{
|
|
||||||
public const string IDENTITY_ID = "9e3163b9-1ae6-4652-9dc6-7898ab7b7a00";
|
public const string IDENTITY_ID = "9e3163b9-1ae6-4652-9dc6-7898ab7b7a00";
|
||||||
|
|
||||||
private readonly RequestDelegate _next;
|
private readonly RequestDelegate _next;
|
||||||
@ -27,5 +23,4 @@ namespace FunctionalTests.Middleware
|
|||||||
httpContext.User.AddIdentity(identity);
|
httpContext.User.AddIdentity(identity);
|
||||||
await _next.Invoke(httpContext);
|
await _next.Invoke(httpContext);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -1,13 +1,7 @@
|
|||||||
using Microsoft.AspNetCore.Hosting;
|
namespace FunctionalTests.Services.Basket;
|
||||||
using Microsoft.AspNetCore.TestHost;
|
|
||||||
using Microsoft.Extensions.Configuration;
|
|
||||||
using System.IO;
|
|
||||||
using System.Reflection;
|
|
||||||
|
|
||||||
namespace FunctionalTests.Services.Basket
|
public class BasketScenariosBase
|
||||||
{
|
{
|
||||||
public class BasketScenariosBase
|
|
||||||
{
|
|
||||||
private const string ApiUrlBase = "api/v1/basket";
|
private const string ApiUrlBase = "api/v1/basket";
|
||||||
|
|
||||||
|
|
||||||
@ -45,5 +39,4 @@ namespace FunctionalTests.Services.Basket
|
|||||||
public static string CreateBasket = $"{ApiUrlBase}/";
|
public static string CreateBasket = $"{ApiUrlBase}/";
|
||||||
public static string CheckoutOrder = $"{ApiUrlBase}/checkout";
|
public static string CheckoutOrder = $"{ApiUrlBase}/checkout";
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -1,12 +1,7 @@
|
|||||||
using FunctionalTests.Middleware;
|
namespace FunctionalTests.Services.Basket;
|
||||||
using Microsoft.AspNetCore.Builder;
|
|
||||||
using Microsoft.eShopOnContainers.Services.Basket.API;
|
using Microsoft.eShopOnContainers.Services.Basket.API;
|
||||||
using Microsoft.Extensions.Configuration;
|
class BasketTestsStartup : Startup
|
||||||
|
|
||||||
namespace FunctionalTests.Services.Basket
|
|
||||||
{
|
{
|
||||||
class BasketTestsStartup : Startup
|
|
||||||
{
|
|
||||||
public BasketTestsStartup(IConfiguration env) : base(env)
|
public BasketTestsStartup(IConfiguration env) : base(env)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@ -23,5 +18,4 @@ namespace FunctionalTests.Services.Basket
|
|||||||
base.ConfigureAuth(app);
|
base.ConfigureAuth(app);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -1,19 +1,8 @@
|
|||||||
using Microsoft.AspNetCore.Hosting;
|
namespace FunctionalTests.Services.Catalog;
|
||||||
using Microsoft.AspNetCore.TestHost;
|
|
||||||
using Microsoft.eShopOnContainers.BuildingBlocks.IntegrationEventLogEF;
|
|
||||||
using Microsoft.eShopOnContainers.Services.Catalog.API;
|
using Microsoft.eShopOnContainers.Services.Catalog.API;
|
||||||
using Microsoft.eShopOnContainers.Services.Catalog.API.Infrastructure;
|
|
||||||
using Microsoft.Extensions.Configuration;
|
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
|
||||||
using Microsoft.Extensions.Logging;
|
|
||||||
using Microsoft.Extensions.Options;
|
|
||||||
using System.IO;
|
|
||||||
using System.Reflection;
|
|
||||||
|
|
||||||
namespace FunctionalTests.Services.Catalog
|
public class CatalogScenariosBase
|
||||||
{
|
{
|
||||||
public class CatalogScenariosBase
|
|
||||||
{
|
|
||||||
public TestServer CreateServer()
|
public TestServer CreateServer()
|
||||||
{
|
{
|
||||||
var path = Assembly.GetAssembly(typeof(CatalogScenariosBase))
|
var path = Assembly.GetAssembly(typeof(CatalogScenariosBase))
|
||||||
@ -61,5 +50,4 @@ namespace FunctionalTests.Services.Catalog
|
|||||||
{
|
{
|
||||||
public static string UpdateCatalogProduct = "api/v1/catalog/items";
|
public static string UpdateCatalogProduct = "api/v1/catalog/items";
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -1,21 +1,10 @@
|
|||||||
using FunctionalTests.Services.Basket;
|
namespace FunctionalTests.Services;
|
||||||
using FunctionalTests.Services.Catalog;
|
|
||||||
using Microsoft.eShopOnContainers.Services.Basket.API.Model;
|
using Microsoft.eShopOnContainers.Services.Basket.API.Model;
|
||||||
using Microsoft.eShopOnContainers.Services.Catalog.API.Model;
|
using Microsoft.eShopOnContainers.Services.Catalog.API.Model;
|
||||||
using Microsoft.eShopOnContainers.Services.Catalog.API.ViewModel;
|
using Microsoft.eShopOnContainers.Services.Catalog.API.ViewModel;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Net.Http;
|
|
||||||
using System.Text;
|
|
||||||
using System.Text.Json;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Xunit;
|
|
||||||
|
|
||||||
namespace FunctionalTests.Services
|
public class IntegrationEventsScenarios
|
||||||
{
|
{
|
||||||
public class IntegrationEventsScenarios
|
|
||||||
{
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public async Task Post_update_product_price_and_catalog_and_basket_list_modified()
|
public async Task Post_update_product_price_and_catalog_and_basket_list_modified()
|
||||||
{
|
{
|
||||||
@ -130,5 +119,4 @@ namespace FunctionalTests.Services
|
|||||||
}
|
}
|
||||||
return basket;
|
return basket;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
@ -1,21 +1,7 @@
|
|||||||
using FunctionalTests.Extensions;
|
namespace FunctionalTests.Services.Ordering;
|
||||||
using FunctionalTests.Services.Basket;
|
|
||||||
using Microsoft.eShopOnContainers.Services.Basket.API.Model;
|
|
||||||
using Microsoft.eShopOnContainers.WebMVC.ViewModels;
|
|
||||||
using System;
|
|
||||||
using System.Text.Json;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Net.Http;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using WebMVC.Services.ModelDTOs;
|
|
||||||
using Xunit;
|
|
||||||
|
|
||||||
namespace FunctionalTests.Services.Ordering
|
public class OrderingScenarios : OrderingScenariosBase
|
||||||
{
|
{
|
||||||
public class OrderingScenarios : OrderingScenariosBase
|
|
||||||
{
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public async Task Cancel_basket_and_check_order_status_cancelled()
|
public async Task Cancel_basket_and_check_order_status_cancelled()
|
||||||
{
|
{
|
||||||
@ -152,5 +138,4 @@ namespace FunctionalTests.Services.Ordering
|
|||||||
|
|
||||||
return JsonSerializer.Serialize(checkoutBasket);
|
return JsonSerializer.Serialize(checkoutBasket);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -1,20 +1,7 @@
|
|||||||
using Microsoft.AspNetCore.Hosting;
|
namespace FunctionalTests.Services.Ordering;
|
||||||
using Microsoft.AspNetCore.TestHost;
|
|
||||||
using Microsoft.eShopOnContainers.BuildingBlocks.IntegrationEventLogEF;
|
|
||||||
using Microsoft.eShopOnContainers.Services.Ordering.API;
|
|
||||||
using Microsoft.eShopOnContainers.Services.Ordering.API.Infrastructure;
|
|
||||||
using Microsoft.eShopOnContainers.Services.Ordering.Infrastructure;
|
|
||||||
using Microsoft.Extensions.Configuration;
|
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
|
||||||
using Microsoft.Extensions.Logging;
|
|
||||||
using Microsoft.Extensions.Options;
|
|
||||||
using System.IO;
|
|
||||||
using System.Reflection;
|
|
||||||
|
|
||||||
namespace FunctionalTests.Services.Ordering
|
public class OrderingScenariosBase
|
||||||
{
|
{
|
||||||
public class OrderingScenariosBase
|
|
||||||
{
|
|
||||||
public TestServer CreateServer()
|
public TestServer CreateServer()
|
||||||
{
|
{
|
||||||
var path = Assembly.GetAssembly(typeof(OrderingScenariosBase))
|
var path = Assembly.GetAssembly(typeof(OrderingScenariosBase))
|
||||||
@ -73,5 +60,4 @@ namespace FunctionalTests.Services.Ordering
|
|||||||
return $"api/v1/orders/{id}";
|
return $"api/v1/orders/{id}";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -1,12 +1,8 @@
|
|||||||
using FunctionalTests.Middleware;
|
namespace FunctionalTests.Services.Ordering;
|
||||||
using Microsoft.AspNetCore.Builder;
|
|
||||||
using Microsoft.eShopOnContainers.Services.Ordering.API;
|
using Microsoft.eShopOnContainers.Services.Ordering.API;
|
||||||
using Microsoft.Extensions.Configuration;
|
|
||||||
|
|
||||||
namespace FunctionalTests.Services.Ordering
|
public class OrderingTestsStartup : Startup
|
||||||
{
|
{
|
||||||
public class OrderingTestsStartup : Startup
|
|
||||||
{
|
|
||||||
public OrderingTestsStartup(IConfiguration env) : base(env)
|
public OrderingTestsStartup(IConfiguration env) : base(env)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@ -23,5 +19,4 @@ namespace FunctionalTests.Services.Ordering
|
|||||||
base.ConfigureAuth(app);
|
base.ConfigureAuth(app);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user