12 changed files with 398 additions and 94 deletions
-
25ThirdPlugIns/Shentun.Peis.PlugIns.Gem/test/Shentun.Peis.PlugIns.Gem.Test/HisTest.cs
-
8src/Shentun.ColumnReferencePlugIns/ColumnReferencePlugIns.cs
-
8src/Shentun.ColumnReferencePlugIns/ColumnReferencePlugInsBase.cs
-
2src/Shentun.ColumnReferencePlugIns/ColumnReferencePlugInsDbBase.cs
-
21src/Shentun.ColumnReferencePlugIns/PeisPlugInsModule.cs
-
1src/Shentun.ColumnReferencePlugIns/Shentun.Peis.PlugIns.csproj
-
12src/Shentun.Peis.Application.Contracts/ColumnReferences/ColumnReferenceInterfaceCodeValueDto.cs
-
12src/Shentun.Peis.Application.Contracts/ColumnReferences/ColumnReferenceInterfaceCodeValuesInputDto.cs
-
268src/Shentun.Peis.Application/ColumnReferences/ColumnReferenceAppService.cs
-
7src/Shentun.Peis.Application/PeisApplicationModule.cs
-
124test/Shentun.Peis.Application.Tests/ColumnReferenceAppServiceTest.cs
-
4test/Shentun.Peis.ColumnReference.Tests/ColumnReferencePlugInsTest.cs
@ -0,0 +1,21 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp; |
|||
using Volo.Abp.Modularity; |
|||
|
|||
namespace Shentun.Peis.PlugIns |
|||
{ |
|||
public class PeisPlugInsModule : AbpModule |
|||
{ |
|||
public override void OnApplicationInitialization(ApplicationInitializationContext context) |
|||
{ |
|||
//var myService = context.ServiceProvider
|
|||
// .GetRequiredService<MyService>();
|
|||
|
|||
//myService.Initialize();
|
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,12 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Text; |
|||
|
|||
namespace Shentun.Peis.ColumnReferences |
|||
{ |
|||
public class ColumnReferenceInterfaceCodeValueDto |
|||
{ |
|||
public string CodeValue { get; set; } |
|||
public string DisplayName{ get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,12 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Text; |
|||
|
|||
namespace Shentun.Peis.ColumnReferences |
|||
{ |
|||
public class ColumnReferenceInterfaceCodeValuesInputDto |
|||
{ |
|||
public Guid ColumnReferenceId { get; set; } |
|||
public string Code { get; set;} |
|||
} |
|||
} |
|||
@ -0,0 +1,124 @@ |
|||
using Shentun.Peis.ChargeRequests; |
|||
using Shentun.Peis.ColumnReferences; |
|||
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; |
|||
using Xunit.Abstractions; |
|||
|
|||
namespace Shentun.Peis |
|||
{ |
|||
public class ColumnReferenceAppServiceTest : PeisApplicationTestBase |
|||
{ |
|||
private readonly IRepository<ColumnReference, Guid> _repository; |
|||
private readonly ColumnReferenceAppService _appService; |
|||
private readonly ITestOutputHelper _output; |
|||
private readonly IUnitOfWorkManager _unitOfWorkManager; |
|||
public ColumnReferenceAppServiceTest(ITestOutputHelper testOutputHelper) |
|||
{ |
|||
_output = testOutputHelper; |
|||
_unitOfWorkManager = GetRequiredService<IUnitOfWorkManager>(); |
|||
_repository = GetRequiredService<IRepository<ColumnReference, Guid>>(); |
|||
_appService = GetRequiredService<ColumnReferenceAppService>(); |
|||
} |
|||
|
|||
[Fact] |
|||
public async Task GetAppColumnNames() |
|||
{ |
|||
using (var unitOfWork = _unitOfWorkManager.Begin(isTransactional: true)) |
|||
{ |
|||
|
|||
var entity = new ColumnReferenceIdInputDto() |
|||
{ |
|||
Id = new Guid("3a1222e4-3249-34a2-85f0-f72e974de543"), |
|||
|
|||
}; |
|||
|
|||
var newEntity = await _appService.GetAppColumnNamesAsync(entity); |
|||
if(newEntity != null) |
|||
{ |
|||
foreach(var column in newEntity) |
|||
{ |
|||
_output.WriteLine(column); |
|||
} |
|||
} |
|||
await unitOfWork.CompleteAsync(); |
|||
} |
|||
} |
|||
|
|||
[Fact] |
|||
public async Task GetInterfaceColumnNames() |
|||
{ |
|||
using (var unitOfWork = _unitOfWorkManager.Begin(isTransactional: true)) |
|||
{ |
|||
|
|||
var entity = new ColumnReferenceIdInputDto() |
|||
{ |
|||
Id = new Guid("3a1222e4-3249-34a2-85f0-f72e974de543"), |
|||
|
|||
}; |
|||
|
|||
var newEntity = await _appService.GetInterfaceColumnNamesAsync(entity); |
|||
if (newEntity != null) |
|||
{ |
|||
foreach (var column in newEntity) |
|||
{ |
|||
_output.WriteLine(column); |
|||
} |
|||
} |
|||
await unitOfWork.CompleteAsync(); |
|||
} |
|||
} |
|||
|
|||
[Fact] |
|||
public async Task GetAppCodeValues() |
|||
{ |
|||
using (var unitOfWork = _unitOfWorkManager.Begin(isTransactional: true)) |
|||
{ |
|||
|
|||
var entity = new ColumnReferenceIdInputDto() |
|||
{ |
|||
Id = new Guid("3a1222e4-3249-34a2-85f0-f72e974de543"), |
|||
|
|||
}; |
|||
|
|||
var newEntity = await _appService.GetAppCodeValuesAsync(entity); |
|||
foreach (var column in newEntity) |
|||
{ |
|||
_output.WriteLine(column.DisplayName); |
|||
} |
|||
await unitOfWork.CompleteAsync(); |
|||
} |
|||
} |
|||
|
|||
[Fact] |
|||
public async Task GetInterfaceCodeValues() |
|||
{ |
|||
using (var unitOfWork = _unitOfWorkManager.Begin(isTransactional: true)) |
|||
{ |
|||
|
|||
var entity = new ColumnReferenceIdInputDto() |
|||
{ |
|||
Id = new Guid("3a1222e4-3249-34a2-85f0-f72e974de543"), |
|||
|
|||
}; |
|||
|
|||
var newEntity = await _appService.GetInterfaceCodeValuesAsync(entity); |
|||
if(newEntity != null) |
|||
{ |
|||
foreach (var column in newEntity) |
|||
{ |
|||
_output.WriteLine(column.DisplayName); |
|||
} |
|||
} |
|||
|
|||
await unitOfWork.CompleteAsync(); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue