2 changed files with 79 additions and 15 deletions
-
31src/Shentun.Peis.Domain/Items/ItemManager.cs
-
63test/Shentun.Peis.Domain.Tests/ItemManagerTest.cs
@ -0,0 +1,63 @@ |
|||||
|
using Shentun.Peis.CardRegisters; |
||||
|
using Shentun.Peis.Enums; |
||||
|
using Shentun.Peis.IncludeDetails; |
||||
|
using Shentun.Peis.Models; |
||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using System.Text; |
||||
|
using System.Threading.Tasks; |
||||
|
using Volo.Abp.Domain.Repositories; |
||||
|
using Volo.Abp.Uow; |
||||
|
using Xunit.Abstractions; |
||||
|
using Xunit; |
||||
|
using Shentun.Peis.Items; |
||||
|
using Shentun.Utilities; |
||||
|
|
||||
|
namespace Shentun.Peis |
||||
|
{ |
||||
|
|
||||
|
|
||||
|
public class ItemManagerTest : PeisDomainTestBase |
||||
|
{ |
||||
|
private readonly ItemManager _itemManager; |
||||
|
|
||||
|
private readonly ITestOutputHelper _output; |
||||
|
private readonly IUnitOfWorkManager _unitOfWorkManager; |
||||
|
|
||||
|
public ItemManagerTest(ITestOutputHelper output) |
||||
|
{ |
||||
|
_output = output; |
||||
|
_itemManager = GetRequiredService<ItemManager>(); |
||||
|
_unitOfWorkManager = GetRequiredService<IUnitOfWorkManager>(); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
[Fact] |
||||
|
[UnitOfWork] |
||||
|
public async void CheckAndDeleteAsyncTest() |
||||
|
{ |
||||
|
var id = new Guid("3a0e8292-6c97-0866-4047-de7c8390a94c"); |
||||
|
using (IUnitOfWork unitOfWork = _unitOfWorkManager.Begin()) |
||||
|
{ |
||||
|
await _itemManager.CheckAndDeleteAsync(id); |
||||
|
|
||||
|
_output.WriteLine("123"); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
//[Fact]
|
||||
|
//public async void CreateAsyncTest()
|
||||
|
//{
|
||||
|
// var entity = new Item();
|
||||
|
// var newentity = await _itemManager.CreateAsync(entity);
|
||||
|
// _output.WriteLine(newentity.Id.ToString());
|
||||
|
//}
|
||||
|
|
||||
|
|
||||
|
} |
||||
|
} |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue