Add CurrentUserSessionService for session ID retrieval

Introduces ICurrentUserSessionService and its implementation to provide access to the current user's session ID via the 'sid' claim. Registers the service in DI and adds comprehensive unit tests to validate correct and error scenarios.
This commit is contained in:
Artemy
2025-07-25 18:07:05 +07:00
parent ce630fbe0a
commit 751c30dedd
5 changed files with 145 additions and 1 deletions
@@ -1,5 +1,6 @@
using System.Security.Claims;
using Govor.Application.Infrastructure.Extensions;
using Govor.Application.Interfaces.Infrastructure.Extensions;
using Microsoft.AspNetCore.Http;
using Moq;
@@ -9,7 +10,7 @@ namespace Govor.Application.Tests.Infrastructure.Extensions;
public class CurrentUserServiceTests
{
private Mock<IHttpContextAccessor> _httpContextAccessorMock;
private CurrentUserService _currentUserService;
private ICurrentUserService _currentUserService;
[SetUp]
public void SetUp()