Update ListUsersTests to validate UserListFilter sorting and defaults
ci / build-backend (push) Successful in 2m47s
ci / build-frontend (push) Successful in 1m7s
ci / tests (push) Successful in 2m50s
ci / sonar (push) Successful in 6m45s

Enhanced the ListUsersTests by adding a comprehensive check for the UserListFilter, ensuring that sorting defaults are correctly applied when not specified in the request. This change improves the accuracy of the tests related to user listing functionality.
This commit is contained in:
Leonid Pershin
2026-07-27 11:39:49 +03:00
parent 96ff2cc7ab
commit 61f934d19f
@@ -50,10 +50,12 @@ public class ListUsersTests
CancellationToken.None CancellationToken.None
); );
// Сверяем фильтр целиком, а не по полям: он record, и значение сравнивается по значению —
// так проверяются и умолчания сортировки, которые запрос не задавал.
await identity await identity
.Received(1) .Received(1)
.ListUsersAsync( .ListUsersAsync(
Arg.Is<UserListFilter>(f => f.Sort == null && !f.Desc && f.Search == null), new UserListFilter(1, 20, null, null, null),
Arg.Any<CancellationToken>() Arg.Any<CancellationToken>()
); );
} }