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