mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-10-14 17:54:42 +00:00
27 lines
759 B
C#
27 lines
759 B
C#
using Domain.Entities;
|
|
using Features.Users.Queries.GetAllUsers;
|
|
using Features.Users.Repository;
|
|
using FluentAssertions;
|
|
using Moq;
|
|
|
|
namespace Features.Users.Tests.Queries;
|
|
|
|
public class GetAllUsersHandlerTests
|
|
{
|
|
[Fact]
|
|
public async Task Handle_PassesLimitAndOffset_ToRepository()
|
|
{
|
|
Mock<IUserListRepository> repoMock = new();
|
|
GetAllUsersHandler handler = new(repoMock.Object);
|
|
repoMock.Setup(r => r.GetAllAsync(10, 5)).ReturnsAsync(Array.Empty<UserAccount>());
|
|
|
|
IEnumerable<UserAccount> result = await handler.Handle(
|
|
new GetAllUsersQuery(10, 5),
|
|
CancellationToken.None
|
|
);
|
|
|
|
result.Should().BeEmpty();
|
|
repoMock.Verify(r => r.GetAllAsync(10, 5), Times.Once);
|
|
}
|
|
}
|