Skip to content

Commit

Permalink
test: fix invalidId tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tnotheis committed Jan 28, 2025
1 parent 2e69771 commit 78d6d91
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ public static void ShouldHaveValidationErrorForId<T>(this TestValidationResult<T
{
var errorsForProperty = testValidationResult.ShouldHaveValidationErrorFor(propertyWithInvalidId);
errorsForProperty.Should().Contain(r =>
r.ErrorCode == "error.platform.validation.invalidPropertyValue" && r.ErrorMessage == "The ID is not valid. Check length, prefix and the used characters.");
r.ErrorCode == "error.platform.validation.invalidPropertyValue" && r.ErrorMessage.Contains("The ID or Address is not valid. Check length, prefix and the used characters."));
}

public static void ShouldHaveValidationErrorForIdInCollection<T>(this TestValidationResult<T> testValidationResult, string collectionWithInvalidId, int indexWithInvalidId)
{
var errorsForProperty = testValidationResult.ShouldHaveValidationErrorFor($"{collectionWithInvalidId}[{indexWithInvalidId}]");
errorsForProperty.Should().Contain(r =>
r.ErrorCode == "error.platform.validation.invalidPropertyValue" && r.ErrorMessage == "The ID is not valid. Check length, prefix and the used characters.");
r.ErrorCode == "error.platform.validation.invalidPropertyValue" && r.ErrorMessage.Contains("The ID or Address is not valid. Check length, prefix and the used characters."));
}
}

0 comments on commit 78d6d91

Please sign in to comment.