[AZ-200] Drop email length rule

Made-with: Cursor
This commit is contained in:
Oleksandr Bezdieniezhnykh
2026-04-16 06:59:12 +03:00
parent 88c7b288df
commit 74f5594b0c
2 changed files with 3 additions and 3 deletions
@@ -15,7 +15,7 @@ public class RegisterUserValidator : AbstractValidator<RegisterUserRequest>
public RegisterUserValidator()
{
RuleFor(r => r.Email)
.MinimumLength(8).WithErrorCode(ExceptionEnum.EmailLengthIncorrect.ToString()).WithMessage("Email address should be at least 8 characters.")
.NotEmpty().WithErrorCode(ExceptionEnum.EmailLengthIncorrect.ToString()).WithMessage("Email address is required.")
.EmailAddress().WithErrorCode(ExceptionEnum.WrongEmail.ToString()).WithMessage("Email address is not valid.");
RuleFor(r => r.Password)
+2 -2
View File
@@ -161,14 +161,14 @@ public sealed class UserManagementTests
}
[Fact]
public async Task Registration_rejects_short_email_with_400()
public async Task Registration_rejects_empty_email_with_400()
{
// Arrange
using var client = _fixture.CreateAuthenticatedClient(_fixture.AdminToken);
// Act
using var response = await client.PostAsync("/users",
new { email = "ab@c.de", password = "ValidPass123", role = 10 });
new { email = "", password = "ValidPass123", role = 10 });
// Assert
response.StatusCode.Should().Be(HttpStatusCode.BadRequest);