|
@@ -43,8 +43,9 @@ public class SnapshotApplicationTest : TestBase
|
|
|
private readonly IGuiderSystemService _guiderSystemService;
|
|
|
private readonly ISystemSettingCacheManager _systemSettingCacheManager;
|
|
|
private readonly ICommunityInfoRepository _communityInfoRepository;
|
|
|
+ private readonly IIndustryLogRepository _industryLogRepository;
|
|
|
|
|
|
- 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, ICommunityInfoRepository communityInfoRepository) : 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, ICommunityInfoRepository communityInfoRepository, IIndustryLogRepository industryLogRepository) : base(accountRepository, roleRepository, userController, scopeFactory, userRepository, httpContextAccessor, thirdService, thirdAccount)
|
|
|
{
|
|
|
_snapshotApplication = snapshotApplication;
|
|
|
_identityAppService = identityAppService;
|
|
@@ -60,6 +61,7 @@ public class SnapshotApplicationTest : TestBase
|
|
|
_guiderSystemService = guiderSystemService;
|
|
|
_systemSettingCacheManager = systemSettingCacheManager;
|
|
|
_communityInfoRepository = communityInfoRepository;
|
|
|
+ _industryLogRepository = industryLogRepository;
|
|
|
}
|
|
|
|
|
|
[Fact]
|
|
@@ -285,6 +287,9 @@ public class SnapshotApplicationTest : TestBase
|
|
|
{
|
|
|
await _snapshotApplication.AddVolunteerAsync(new AddVolunteerInDto { Name = _sessionContext.UserName, PhoneNumber = _sessionContext.Phone }, CancellationToken.None);
|
|
|
var inDto = _fixture.Create<AddVolunteerReportInDto>();
|
|
|
+ inDto.JobType = "电焊";
|
|
|
+ inDto.PhoneNumber = "13999989" + DateTime.Now.ToString("ss");
|
|
|
+ inDto.Name = "单元测试" + DateTime.Now.ToString("ss");
|
|
|
foreach (var item in inDto.Files)
|
|
|
{
|
|
|
item.FileName = DateTime.Now.ToShortTimeString() + "文件.doc";
|
|
@@ -435,6 +440,19 @@ public class SnapshotApplicationTest : TestBase
|
|
|
var order = _orderServiceMock.CreateSnapshotOrder()
|
|
|
.GetCreateResult();
|
|
|
await _snapshotApplication.PostOrderGuiderSystemAsync(order.Id, CancellationToken.None);
|
|
|
+ await _orderSnapshotRepository.Updateable()
|
|
|
+ .SetColumns(m => m.IndustryName, "修改行业名称")
|
|
|
+ .Where(m => m.Id == order.Id)
|
|
|
+ .ExecuteCommandAsync();
|
|
|
+ var industryLog = await _industryLogRepository.Queryable()
|
|
|
+ .Where(m => m.OrderId == order.Id)
|
|
|
+ .FirstAsync();
|
|
|
+ industryLog.ShouldNotBeNull();
|
|
|
+ industryLog.IndustryName.ShouldBe("修改行业名称");
|
|
|
+ await _orderSnapshotRepository.Updateable()
|
|
|
+ .SetColumns(m => m.IndustryName, industryLog.OldIndustryName)
|
|
|
+ .Where(m => m.Id == order.Id)
|
|
|
+ .ExecuteCommandAsync();
|
|
|
var orderSnapshot = await _orderSnapshotRepository.GetAsync(order.Id);
|
|
|
var replyDto = new GuiderSystemInDto
|
|
|
{
|