|
@@ -12,6 +12,7 @@ using Hotline.Share.Dtos.Snapshot;
|
|
|
using Hotline.Share.Enums.Snapshot;
|
|
|
using Hotline.Share.Requests;
|
|
|
using Hotline.Share.Tools;
|
|
|
+using Hotline.Snapshot;
|
|
|
using Hotline.Snapshot.IRepository;
|
|
|
using Hotline.Tests.Mock;
|
|
|
using Hotline.ThirdAccountDomainServices;
|
|
@@ -45,8 +46,10 @@ public class OrderSnapshotApplicationTest : TestBase
|
|
|
private readonly IRedPackApplication _redPackApplication;
|
|
|
private readonly IOrderRepository _orderRepository;
|
|
|
private readonly IIndustryCaseRepository _industryCaseRepository;
|
|
|
+ private readonly ISnapshotPointsRecordRepository _pointsRecordRepository;
|
|
|
+ private readonly IIndustryRepository _industryRepository;
|
|
|
|
|
|
- public OrderSnapshotApplicationTest(IAccountRepository accountRepository, IRepository<Role> roleRepository, UserController userController, IServiceScopeFactory scopeFactory, IRepository<User> userRepository, IHttpContextAccessor httpContextAccessor, IThirdIdentiyService thirdIdentiyService, IThirdAccountRepository thirdAccountRepository, OrderServiceMock orderServiceMock, ISystemDicDataCacheManager systemDicDataCacheManager, IOrderSnapshotRepository orderSnapshotRepository, IOrderSnapshotApplication orderSnapshotApplication, ISnapshotApplication snapshotApplication, IIndustryLogRepository industryLogRepository, ICommunityInfoRepository communityInfoRepository, IRedPackAuditRepository redPackAuditRepository, IRedPackRecordRepository redPackRecordRepository, ISnapshotLabelLogRepository snapshotLabelLogRepository, ITypedCache<SystemSetting> cacheSettingData, IRedPackApplication redPackApplication, IOrderRepository orderRepository, ThirdAccounSupplierFactory thirdAccountDomainFactory, IIndustryCaseRepository industryCaseRepository) : base(accountRepository, roleRepository, userController, scopeFactory, userRepository, httpContextAccessor, thirdIdentiyService, thirdAccountRepository, cacheSettingData, thirdAccountDomainFactory)
|
|
|
+ public OrderSnapshotApplicationTest(IAccountRepository accountRepository, IRepository<Role> roleRepository, UserController userController, IServiceScopeFactory scopeFactory, IRepository<User> userRepository, IHttpContextAccessor httpContextAccessor, IThirdIdentiyService thirdIdentiyService, IThirdAccountRepository thirdAccountRepository, OrderServiceMock orderServiceMock, ISystemDicDataCacheManager systemDicDataCacheManager, IOrderSnapshotRepository orderSnapshotRepository, IOrderSnapshotApplication orderSnapshotApplication, ISnapshotApplication snapshotApplication, IIndustryLogRepository industryLogRepository, ICommunityInfoRepository communityInfoRepository, IRedPackAuditRepository redPackAuditRepository, IRedPackRecordRepository redPackRecordRepository, ISnapshotLabelLogRepository snapshotLabelLogRepository, ITypedCache<SystemSetting> cacheSettingData, IRedPackApplication redPackApplication, IOrderRepository orderRepository, ThirdAccounSupplierFactory thirdAccountDomainFactory, IIndustryCaseRepository industryCaseRepository, ISnapshotPointsRecordRepository pointsRecordRepository, IIndustryRepository industryRepository) : base(accountRepository, roleRepository, userController, scopeFactory, userRepository, httpContextAccessor, thirdIdentiyService, thirdAccountRepository, cacheSettingData, thirdAccountDomainFactory)
|
|
|
{
|
|
|
_orderServiceMock = orderServiceMock;
|
|
|
_systemDicDataCacheManager = systemDicDataCacheManager;
|
|
@@ -61,6 +64,8 @@ public class OrderSnapshotApplicationTest : TestBase
|
|
|
_redPackApplication = redPackApplication;
|
|
|
_orderRepository = orderRepository;
|
|
|
_industryCaseRepository = industryCaseRepository;
|
|
|
+ _pointsRecordRepository = pointsRecordRepository;
|
|
|
+ _industryRepository = industryRepository;
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -106,6 +111,15 @@ public class OrderSnapshotApplicationTest : TestBase
|
|
|
.办理到网格员(SetZuoXi)
|
|
|
.StepHandle(async (order, mock) =>
|
|
|
{
|
|
|
+ var industry = await _industryRepository.Queryable()
|
|
|
+ .LeftJoin<OrderSnapshot>((industry, snapshot) => industry.Id == snapshot.IndustryId)
|
|
|
+ .Where((industry, snapshot) => snapshot.Id == order.Id)
|
|
|
+ .Select((industry, snapshot) => new Industry(), true)
|
|
|
+ .FirstAsync();
|
|
|
+ var pointsRecord = await _pointsRecordRepository.Queryable().Where(m => m.OrderId == order.Id && m.Source == EPointsSource.Report).FirstAsync();
|
|
|
+ pointsRecord.ShouldNotBeNull();
|
|
|
+ pointsRecord.Points.ShouldBe(industry.ReportPoints!.Value);
|
|
|
+
|
|
|
await _snapshotApplication.PostOrderGuiderSystemAsync(order.Id, CancellationToken.None);
|
|
|
var orderSnapshot = await _orderSnapshotRepository.GetAsync(order.Id);
|
|
|
orderSnapshot.IndustryName = "修改行业名称";
|