|
@@ -38,8 +38,9 @@ public class SnapshotApplicationTest : TestBase
|
|
|
private readonly IOrderRepository _orderRepository;
|
|
|
private readonly IOrderSnapshotRepository _orderSnapshotRepository;
|
|
|
private readonly ISessionContext _sessionContext;
|
|
|
+ private readonly IGuiderSystemService _guiderSystemService;
|
|
|
|
|
|
- public SnapshotApplicationTest(IAccountRepository accountRepository, IRepository<Role> roleRepository, UserController userController, IServiceScopeFactory scopeFactory, IRepository<User> userRepository, IHttpContextAccessor httpContextAccessor, ISnapshotApplication snapshotApplication, IIdentityAppService identityAppService, IRepository<RedPackRecord> redPackRecordRepository, IIndustryApplication industryApplication, IIndustryRepository industryRepository, IFileRepository fileRepository, OrderServiceMock orderServiceMock, IOrderRepository orderRepository, IOrderSnapshotRepository orderSnapshotRepository, IThirdIdentiyService thirdService, IThirdAccountRepository thirdAccount, ISessionContext sessionContext) : base(accountRepository, roleRepository, userController, scopeFactory, userRepository, httpContextAccessor, thirdService, thirdAccount)
|
|
|
+ public SnapshotApplicationTest(IAccountRepository accountRepository, IRepository<Role> roleRepository, UserController userController, IServiceScopeFactory scopeFactory, IRepository<User> userRepository, IHttpContextAccessor httpContextAccessor, ISnapshotApplication snapshotApplication, IIdentityAppService identityAppService, IRepository<RedPackRecord> redPackRecordRepository, IIndustryApplication industryApplication, IIndustryRepository industryRepository, IFileRepository fileRepository, OrderServiceMock orderServiceMock, IOrderRepository orderRepository, IOrderSnapshotRepository orderSnapshotRepository, IThirdIdentiyService thirdService, IThirdAccountRepository thirdAccount, ISessionContext sessionContext, IGuiderSystemService guiderSystemService) : base(accountRepository, roleRepository, userController, scopeFactory, userRepository, httpContextAccessor, thirdService, thirdAccount)
|
|
|
{
|
|
|
_snapshotApplication = snapshotApplication;
|
|
|
_identityAppService = identityAppService;
|
|
@@ -52,6 +53,7 @@ public class SnapshotApplicationTest : TestBase
|
|
|
_orderSnapshotRepository = orderSnapshotRepository;
|
|
|
SetWeiXin();
|
|
|
_sessionContext = sessionContext;
|
|
|
+ _guiderSystemService = guiderSystemService;
|
|
|
}
|
|
|
|
|
|
[Fact]
|
|
@@ -242,7 +244,7 @@ public class SnapshotApplicationTest : TestBase
|
|
|
[Fact]
|
|
|
public async Task AddVolunteerReport_Test()
|
|
|
{
|
|
|
- await _snapshotApplication.AddVolunteerAsync(new AddVolunteerInDto {Name = _sessionContext.UserName, PhoneNumber = _sessionContext.Phone }, CancellationToken.None);
|
|
|
+ await _snapshotApplication.AddVolunteerAsync(new AddVolunteerInDto { Name = _sessionContext.UserName, PhoneNumber = _sessionContext.Phone }, CancellationToken.None);
|
|
|
var inDto = _fixture.Create<AddVolunteerReportInDto>();
|
|
|
foreach (var item in inDto.Files)
|
|
|
{
|
|
@@ -262,6 +264,17 @@ public class SnapshotApplicationTest : TestBase
|
|
|
third.InvitationCode.ShouldBe(code);
|
|
|
}
|
|
|
|
|
|
+ [Fact]
|
|
|
+ public async Task PostOrder_Test()
|
|
|
+ {
|
|
|
+ var orderSnapshot = await _orderSnapshotRepository.Queryable()
|
|
|
+ .OrderByDescending(m => m.CreationTime).FirstAsync();
|
|
|
+ var order = await _orderRepository.GetAsync(orderSnapshot.Id);
|
|
|
+ var token = new ThirdTokenDto { AppId = "TAjYAYuA", Secret = "c01eb299b9d784bf55681af4da86bab6ba428101" };
|
|
|
+ var result = await _guiderSystemService.PostOrder(order, orderSnapshot, token);
|
|
|
+ result.ShouldNotBeNull();
|
|
|
+ }
|
|
|
+
|
|
|
[Fact]
|
|
|
public async Task GetPractitionerItems_Test()
|
|
|
{
|