mirror of https://github.com/EasyAbp/EShop.git
2 changed files with 77 additions and 5 deletions
@ -1,10 +1,22 @@ |
|||||
namespace EasyAbp.EShop.Orders |
using System; |
||||
|
using EasyAbp.EShop.Orders.EntityFrameworkCore; |
||||
|
using EasyAbp.EShop.Products.Products; |
||||
|
using Microsoft.Extensions.DependencyInjection; |
||||
|
using NSubstitute; |
||||
|
|
||||
|
namespace EasyAbp.EShop.Orders |
||||
{ |
{ |
||||
/* Inherit from this class for your application layer tests. |
/* Inherit from this class for your application layer tests. |
||||
* See SampleAppService_Tests for example. |
* See SampleAppService_Tests for example. |
||||
*/ |
*/ |
||||
public abstract class OrdersApplicationTestBase : OrdersTestBase<EShopOrdersApplicationTestModule> |
public abstract class OrdersApplicationTestBase : OrdersTestBase<EShopOrdersApplicationTestModule> |
||||
{ |
{ |
||||
|
protected void UsingDbContext(Action<IOrdersDbContext> action) |
||||
|
{ |
||||
|
using (var dbContext = GetRequiredService<IOrdersDbContext>()) |
||||
|
{ |
||||
|
action.Invoke(dbContext); |
||||
|
} |
||||
|
} |
||||
} |
} |
||||
} |
} |
||||
Loading…
Reference in new issue