technical edits

This commit is contained in:
Artemy
2025-12-12 17:23:01 +07:00
parent bf2aca40d3
commit 7e6f914878
23 changed files with 461 additions and 114 deletions
@@ -1,6 +1,7 @@
using Govor.Application.Services;
using Govor.Core.Models.Users;
using Govor.Core.Repositories.Users;
using Govor.Data.Repositories.Exceptions;
using Microsoft.Extensions.Logging;
using Moq;
@@ -64,7 +65,19 @@ public class ProfileServiceTests
Assert.ThrowsAsync<NullReferenceException>(() =>
_service.GetUserProfileAsync(Guid.NewGuid()));
}
[Test]
public void GetUserProfileAsync_ThrowsNotFoundException_WhenNotFoundByKeyException()
{
// Arrange
var userId = Guid.NewGuid();
_mockUsersRepo.Setup(r => r.FindByIdAsync(It.IsAny<Guid>()))
.ThrowsAsync(new NotFoundByKeyException<Guid>(userId));
// Act + Assert
Assert.ThrowsAsync<NotFoundException>(() =>
_service.GetUserProfileAsync(userId));
}
// ---------- SetDescription ----------
[Test]