mirror of
https://github.com/Govor-team/Govor.git
synced 2026-07-21 19:54:55 +00:00
Refactor user context handling with CurrentUserService
Introduced ICurrentUserService and its implementation to centralize retrieval of the current user's ID from claims. Updated FriendsController to use this service instead of direct claim access. Registered the service and IHttpContextAccessor in DI. Added integration tests for FriendsController. Moved UsernameValidator to Infrastructure/Validators.
This commit is contained in:
@@ -86,9 +86,9 @@ public class AuthControllerTests
|
||||
var result = await _controller.Register(request);
|
||||
|
||||
// Assert
|
||||
Assert.That(result, Is.InstanceOf<BadRequestObjectResult>());
|
||||
var badRequestResult = result as BadRequestObjectResult;
|
||||
Assert.That(badRequestResult.Value, Is.EqualTo("Invite link invalid."));
|
||||
Assert.That(result, Is.InstanceOf<NotFoundObjectResult>());
|
||||
var notFoundObjectResult = result as NotFoundObjectResult;
|
||||
Assert.That(notFoundObjectResult.Value, Is.EqualTo("Invite link invalid."));
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
||||
Reference in New Issue
Block a user