mirror of
https://github.com/Govor-team/Govor.git
synced 2026-07-21 19:54:55 +00:00
Add unit tests and implement group repository interfaces
Introduces comprehensive unit tests for MessageService covering send, edit, and delete message scenarios. Adds and implements IGroupsRepository, IGroupsReader, and IGroupsWriter interfaces with method stubs in GroupRepository. Updates ChatGroup model with Description and ImageId fields, and registers GroupRepository in DI. Fixes parameter order in SendMessage record.
This commit is contained in:
@@ -4,6 +4,9 @@ public class ChatGroup
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Description { get; set; }
|
||||
public Guid ImageId { get; set; }
|
||||
|
||||
public List<string> InviteCode { get; set; }
|
||||
public bool IsChannel { get; set; }
|
||||
public bool IsPrivate { get; set; }
|
||||
|
||||
@@ -1,6 +1,13 @@
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace Govor.Core.Repositories.Groups;
|
||||
|
||||
public interface IGroupsReader
|
||||
{
|
||||
|
||||
public Task<List<Group>> GetAllAsync();
|
||||
public Task<Group> GetByIdAsync(Guid id);
|
||||
public Task<List<Group>> FindByNameAsync(string name);
|
||||
public Task<List<Group>> GetByAdminIdAsync(Guid adminId);
|
||||
public Task<List<Group>> GetByUserIdAsync(Guid adminId);
|
||||
public bool IsUserMemberOfGroupAsync(Guid userId, Guid groupId);
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
namespace Govor.Core.Repositories.Groups;
|
||||
|
||||
public interface IGroupsRepository : IGroupsReader, IGroupsExist, IGroupsWriter
|
||||
public interface IGroupsRepository : IGroupsReader, IGroupsWriter, IGroupsExist
|
||||
{
|
||||
|
||||
}
|
||||
@@ -1,6 +1,10 @@
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace Govor.Core.Repositories.Groups;
|
||||
|
||||
public interface IGroupsWriter
|
||||
{
|
||||
|
||||
Task Add(Group group);
|
||||
Task Update(Group group);
|
||||
Task Remove(Guid groupId);
|
||||
}
|
||||
Reference in New Issue
Block a user