mirror of
https://github.com/Govor-team/Govor.git
synced 2026-07-21 19:54:55 +00:00
Add username validation and initial friends feature
Introduced a UsernameValidator with Cyrillic and length checks, integrated into AuthService and registration flow. Added InvalidUsernameException and related interface. Updated User model to support friend requests, added FriendsController (stub), and configured Friendship entity in EF Core. Adjusted UserValidator max name length and removed navigation properties from PrivateChat.
This commit is contained in:
@@ -19,6 +19,7 @@ public class AuthServiceTests
|
||||
private Mock<IJwtService> _jwtServiceMock;
|
||||
private Mock<IUsersRepository> _usersRepositoryMock;
|
||||
private Mock<IAdminsRepository> _adminsRepositoryMock;
|
||||
private Mock<IUsernameValidator> _usernameValidatorMock;
|
||||
|
||||
private IAccountService _accountService;
|
||||
|
||||
@@ -38,12 +39,14 @@ public class AuthServiceTests
|
||||
_passwordHasherMock = new Mock<IPasswordHasher>();
|
||||
_jwtServiceMock = new Mock<IJwtService>();
|
||||
_adminsRepositoryMock = new Mock<IAdminsRepository>();
|
||||
_usernameValidatorMock = new Mock<IUsernameValidator>();
|
||||
|
||||
_accountService = new AuthService(
|
||||
_usersRepositoryMock.Object,
|
||||
_jwtServiceMock.Object,
|
||||
_passwordHasherMock.Object,
|
||||
_adminsRepositoryMock.Object
|
||||
_adminsRepositoryMock.Object,
|
||||
_usernameValidatorMock.Object
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user