|
@@ -51,7 +51,7 @@ public class SnapshotBulletionApplicationTest : TestBase
|
|
public async Task Bulletin_Test()
|
|
public async Task Bulletin_Test()
|
|
{
|
|
{
|
|
SetWeiXin();
|
|
SetWeiXin();
|
|
- var bulletinType = _systemDicDataCacheManager.SnapshotBulletinType.First();
|
|
|
|
|
|
+ var bulletinType = _systemDicDataCacheManager.SnapshotBulletinType.First(m => m.DicDataName == "安全卫士");
|
|
var safetyType = await _safetyTypeRepository.Queryable().FirstAsync();
|
|
var safetyType = await _safetyTypeRepository.Queryable().FirstAsync();
|
|
var addRelationInDto = new AddCitizenRelationSafetyTypeInDto { SafetyTypeId = safetyType.Id, CitizenIds = [_sessionContext.UserId] };
|
|
var addRelationInDto = new AddCitizenRelationSafetyTypeInDto { SafetyTypeId = safetyType.Id, CitizenIds = [_sessionContext.UserId] };
|
|
await _snapshotUserApplication.AddCitizenRelationSafetyType(addRelationInDto, CancellationToken.None);
|
|
await _snapshotUserApplication.AddCitizenRelationSafetyType(addRelationInDto, CancellationToken.None);
|
|
@@ -60,7 +60,7 @@ public class SnapshotBulletionApplicationTest : TestBase
|
|
Title = "测试公告" + DateTime.Now.ToLongDateTimeString(),
|
|
Title = "测试公告" + DateTime.Now.ToLongDateTimeString(),
|
|
Content = "没什么内容",
|
|
Content = "没什么内容",
|
|
BulletinTime = DateTime.Now,
|
|
BulletinTime = DateTime.Now,
|
|
- IsSnapshot = true,
|
|
|
|
|
|
+ Shape = Share.Enums.Snapshot.EBulletinShape.Video,
|
|
BulletinTypeId = bulletinType.DicDataValue,
|
|
BulletinTypeId = bulletinType.DicDataValue,
|
|
BulletinTypeName = bulletinType.DicDataName,
|
|
BulletinTypeName = bulletinType.DicDataName,
|
|
SafetyTypeId = [safetyType.Id],
|
|
SafetyTypeId = [safetyType.Id],
|
|
@@ -69,7 +69,7 @@ public class SnapshotBulletionApplicationTest : TestBase
|
|
};
|
|
};
|
|
var bulletinId = await _snapshotBulletinApplication.AddBulletinAsync(inDto, CancellationToken.None);
|
|
var bulletinId = await _snapshotBulletinApplication.AddBulletinAsync(inDto, CancellationToken.None);
|
|
var bulletin = await _bulletinRepository.GetAsync(bulletinId);
|
|
var bulletin = await _bulletinRepository.GetAsync(bulletinId);
|
|
- bulletin.IsSnapshot.ShouldBe(true);
|
|
|
|
|
|
+ bulletin.Shape.ShouldBe(Share.Enums.Snapshot.EBulletinShape.Video);
|
|
bulletin.SafetyTypeId.First().ShouldBe(safetyType.Id);
|
|
bulletin.SafetyTypeId.First().ShouldBe(safetyType.Id);
|
|
bulletin.VideoPath.ShouldBe(inDto.VideoPath);
|
|
bulletin.VideoPath.ShouldBe(inDto.VideoPath);
|
|
bulletin.VideoCoverImgUrl.ShouldBe(inDto.VideoCoverImgUrl);
|
|
bulletin.VideoCoverImgUrl.ShouldBe(inDto.VideoCoverImgUrl);
|
|
@@ -81,11 +81,11 @@ public class SnapshotBulletionApplicationTest : TestBase
|
|
Reason = "审核通过"
|
|
Reason = "审核通过"
|
|
};
|
|
};
|
|
await _snapshotBulletinApplication.ExamineBulletinAsync(examineDto, CancellationToken.None);
|
|
await _snapshotBulletinApplication.ExamineBulletinAsync(examineDto, CancellationToken.None);
|
|
- Thread.Sleep(5 * 1000);
|
|
|
|
|
|
+ Thread.Sleep(10 * 1000);
|
|
//await _snapshotBulletinApplication.NotifyUserAsync(bulletinId, CancellationToken.None);
|
|
//await _snapshotBulletinApplication.NotifyUserAsync(bulletinId, CancellationToken.None);
|
|
|
|
|
|
|
|
|
|
- var notifyItems = await _snapshotApplication.GetNotificationAsync(new GetNotifyInDto(), CancellationToken.None);
|
|
|
|
|
|
+ var notifyItems = await _snapshotApplication.GetNotificationAsync(new GetNotifyInDto { NotifyType = Share.Enums.Snapshot.ENotificationType.Video}, CancellationToken.None);
|
|
notifyItems.Any(m => m.Title == inDto.Title).ShouldBeTrue();
|
|
notifyItems.Any(m => m.Title == inDto.Title).ShouldBeTrue();
|
|
}
|
|
}
|
|
}
|
|
}
|