前端:
1、完善创建群聊逻辑 后端: 1、完善群聊相关接口
This commit is contained in:
@@ -11,6 +11,7 @@ using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using MassTransit;
|
||||
using IM_API.Configs;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
|
||||
namespace IM_API.Tests.Services
|
||||
{
|
||||
@@ -61,7 +62,9 @@ namespace IM_API.Tests.Services
|
||||
});
|
||||
await _context.SaveChangesAsync();
|
||||
|
||||
var service = new GroupService(_context, _mapper, _loggerMock.Object, _publishMock.Object);
|
||||
var userService = new Mock<UserService>();
|
||||
|
||||
var service = new GroupService(_context, _mapper, _loggerMock.Object, _publishMock.Object,userService.Object);
|
||||
|
||||
// Act (执行测试: 第1页,每页2条,倒序)
|
||||
var result = await service.GetGroupListAsync(userId, page: 1, limit: 2, desc: true);
|
||||
@@ -76,8 +79,10 @@ namespace IM_API.Tests.Services
|
||||
[Fact]
|
||||
public async Task GetGroupList_ShouldReturnEmpty_WhenUserHasNoGroups()
|
||||
{
|
||||
|
||||
var userSerivce = new Mock<UserService>();
|
||||
// Arrange
|
||||
var service = new GroupService(_context, _mapper, _loggerMock.Object, _publishMock.Object);
|
||||
var service = new GroupService(_context, _mapper, _loggerMock.Object, _publishMock.Object, userSerivce.Object);
|
||||
|
||||
// Act
|
||||
var result = await service.GetGroupListAsync(userId: 999, page: 1, limit: 10, desc: false);
|
||||
|
||||
Reference in New Issue
Block a user