mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-02 23:11:10 +00:00
Adds alpha picker filtering to the books lite query
This commit is contained in:
1 parent
e72625de7c
commit
6fa154a2e7
12 files changed
+376
-10
No files matched your search
+42
@@ -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();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user