Adds alpha picker filtering to the books lite query

This commit is contained in:
BinaryAlley committed 2026-08-16 10:34:08 -07:00
1 parent e72625de7c
commit 6fa154a2e7
12 files changed
+376 -10

No files matched your search

@@ -46,4 +46,46 @@ public class GetBooksLiteQueryValidatorTests
// Assert
result.ShouldNotHaveAnyValidationErrors();
}
[Fact]
public void Validate_WhenFilterAlphaKeyIsNotASingleLetterOrSpecialKey_ShouldHaveValidationError()
{
// Arrange
GetBooksLiteQuery query = _getBooksLiteQueryFixture.Create();
query = query with { Filter = query.Filter with { FilterAlphaKey = "AB" } };
// Act
List<Error> result = _validator.TestValidate(query);
// Assert
result.ShouldHaveValidationError(Errors.Library.InvalidFilterAlphaKey);
}
[Fact]
public void Validate_WhenFilterAlphaKeyIsASingleLetter_ShouldNotHaveValidationError()
{
// Arrange
GetBooksLiteQuery query = _getBooksLiteQueryFixture.Create();
query = query with { Filter = query.Filter with { FilterAlphaKey = "Q" } };
// Act
List<Error> result = _validator.TestValidate(query);
// Assert
result.ShouldNotHaveAnyValidationErrors();
}
[Fact]
public void Validate_WhenFilterAlphaKeyIsNumberOrSymbol_ShouldNotHaveValidationError()
{
// Arrange
GetBooksLiteQuery query = _getBooksLiteQueryFixture.Create();
query = query with { Filter = query.Filter with { FilterAlphaKey = "#" } };
// Act
List<Error> result = _validator.TestValidate(query);
// Assert
result.ShouldNotHaveAnyValidationErrors();
}
}