|
@@ -4,6 +4,7 @@ using Hotline.Api.Controllers;
|
|
using Hotline.Application.Identity;
|
|
using Hotline.Application.Identity;
|
|
using Hotline.Application.Snapshot;
|
|
using Hotline.Application.Snapshot;
|
|
using Hotline.Application.Tests.Mock;
|
|
using Hotline.Application.Tests.Mock;
|
|
|
|
+using Hotline.Caching.Interfaces;
|
|
using Hotline.File;
|
|
using Hotline.File;
|
|
using Hotline.Identity.Accounts;
|
|
using Hotline.Identity.Accounts;
|
|
using Hotline.Identity.Roles;
|
|
using Hotline.Identity.Roles;
|
|
@@ -39,8 +40,9 @@ public class SnapshotApplicationTest : TestBase
|
|
private readonly IOrderSnapshotRepository _orderSnapshotRepository;
|
|
private readonly IOrderSnapshotRepository _orderSnapshotRepository;
|
|
private readonly ISessionContext _sessionContext;
|
|
private readonly ISessionContext _sessionContext;
|
|
private readonly IGuiderSystemService _guiderSystemService;
|
|
private readonly IGuiderSystemService _guiderSystemService;
|
|
|
|
+ private readonly ISystemSettingCacheManager _systemSettingCacheManager;
|
|
|
|
|
|
- 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)
|
|
|
|
|
|
+ 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, ISystemSettingCacheManager systemSettingCacheManager) : base(accountRepository, roleRepository, userController, scopeFactory, userRepository, httpContextAccessor, thirdService, thirdAccount)
|
|
{
|
|
{
|
|
_snapshotApplication = snapshotApplication;
|
|
_snapshotApplication = snapshotApplication;
|
|
_identityAppService = identityAppService;
|
|
_identityAppService = identityAppService;
|
|
@@ -54,6 +56,7 @@ public class SnapshotApplicationTest : TestBase
|
|
SetWeiXin();
|
|
SetWeiXin();
|
|
_sessionContext = sessionContext;
|
|
_sessionContext = sessionContext;
|
|
_guiderSystemService = guiderSystemService;
|
|
_guiderSystemService = guiderSystemService;
|
|
|
|
+ _systemSettingCacheManager = systemSettingCacheManager;
|
|
}
|
|
}
|
|
|
|
|
|
[Fact]
|
|
[Fact]
|
|
@@ -280,6 +283,7 @@ public class SnapshotApplicationTest : TestBase
|
|
var order = await _orderRepository.GetAsync("08dd18e0-1c9e-4aa5-8dc6-f639e8d1b3ea");
|
|
var order = await _orderRepository.GetAsync("08dd18e0-1c9e-4aa5-8dc6-f639e8d1b3ea");
|
|
var token = new ThirdTokenDto { AppId = "TAjYAYuA", Secret = "c01eb299b9d784bf55681af4da86bab6ba428101" };
|
|
var token = new ThirdTokenDto { AppId = "TAjYAYuA", Secret = "c01eb299b9d784bf55681af4da86bab6ba428101" };
|
|
order.No = DateTime.Now.ToString("yyyyMMddhhmmssyyyy");
|
|
order.No = DateTime.Now.ToString("yyyyMMddhhmmssyyyy");
|
|
|
|
+ orderSnapshot.DeadLine = DateTime.Now.AddDays(_systemSettingCacheManager.OvertimeBack);
|
|
var result = await _guiderSystemService.PostOrder(order, orderSnapshot, token);
|
|
var result = await _guiderSystemService.PostOrder(order, orderSnapshot, token);
|
|
result.ShouldNotBeNull();
|
|
result.ShouldNotBeNull();
|
|
}
|
|
}
|