Adds localization to Lumina.Presentation.Web project

This commit is contained in:
BinaryAlley committed 2024-11-20 21:08:34 +02:00
1 parent 771fa74991
commit 2c31fd8714
65 files changed
+1111 -319

No files matched your search

@@ -142,7 +142,7 @@ public class GetThumbnailEndpointTests : IClassFixture<AuthenticatedLuminaApiFac
problemDetails["traceId"].GetString().Should().NotBeNullOrWhiteSpace();
Dictionary<string, string[]>? errors = problemDetails["errors"].Deserialize<Dictionary<string, string[]>>(_jsonOptions);
errors.Should().ContainKey("General.Validation").WhoseValue.Should().BeEquivalentTo(["ImageQaulityMustBeBetweenZeroAndOneHundred"]);
errors.Should().ContainKey("General.Validation").WhoseValue.Should().BeEquivalentTo(["ImageQualityMustBeBetweenZeroAndOneHundred"]);
}
[Fact]
@@ -172,7 +172,7 @@ public class AuthLoginTests : IClassFixture<LuminaApiFactory>, IDisposable
problemDetails!["status"].GetInt32().Should().Be(StatusCodes.Status429TooManyRequests);
problemDetails["type"].GetString().Should().Be("https://tools.ietf.org/html/rfc7231#section-6.5.29");
problemDetails["title"].GetString().Should().Be("TooManyRequests");
problemDetails["detail"].GetString().Should().Be("Too many attempts. Please try again later.");
problemDetails["detail"].GetString().Should().Be("TooManyRequests");
problemDetails["retryAfter"].GetString().Should().Be("900");
lastResponse.Headers.Should().ContainKey("X-RateLimit-Limit");
@@ -68,7 +68,7 @@ public class AuthRecoverPasswordTests : IClassFixture<LuminaApiFactory>, IDispos
problemDetails!["status"].GetInt32().Should().Be(StatusCodes.Status429TooManyRequests);
problemDetails["type"].GetString().Should().Be("https://tools.ietf.org/html/rfc7231#section-6.5.29");
problemDetails["title"].GetString().Should().Be("TooManyRequests");
problemDetails["detail"].GetString().Should().Be("Too many attempts. Please try again later.");
problemDetails["detail"].GetString().Should().Be("TooManyRequests");
problemDetails["retryAfter"].GetString().Should().Be("900");
lastResponse.Headers.Should().ContainKey("X-RateLimit-Limit");
@@ -101,7 +101,7 @@ public class AuthRegisterTests : IClassFixture<LuminaApiFactory>, IDisposable
problemDetails!["status"].GetInt32().Should().Be(StatusCodes.Status429TooManyRequests);
problemDetails["type"].GetString().Should().Be("https://tools.ietf.org/html/rfc7231#section-6.5.29");
problemDetails["title"].GetString().Should().Be("TooManyRequests");
problemDetails["detail"].GetString().Should().Be("Too many attempts. Please try again later.");
problemDetails["detail"].GetString().Should().Be("TooManyRequests");
problemDetails["retryAfter"].GetString().Should().Be("900");
lastResponse.Headers.Should().ContainKey("X-RateLimit-Limit");
@@ -72,7 +72,7 @@ public class GetThumbnailQueryValidatorTests
TestValidationResult<GetThumbnailQuery> result = _validator.TestValidate(query);
// Assert
result.ShouldHaveValidationErrorFor(x => x.Quality).WithErrorMessage(Errors.Thumbnails.ImageQaulityMustBeBetweenZeroAndOneHundred.Description);
result.ShouldHaveValidationErrorFor(x => x.Quality).WithErrorMessage(Errors.Thumbnails.ImageQualityMustBeBetweenZeroAndOneHundred.Description);
}
[Fact]
@@ -85,7 +85,7 @@ public class GetThumbnailQueryValidatorTests
TestValidationResult<GetThumbnailQuery> result = _validator.TestValidate(query);
// Assert
result.ShouldHaveValidationErrorFor(x => x.Quality).WithErrorMessage(Errors.Thumbnails.ImageQaulityMustBeBetweenZeroAndOneHundred.Description);
result.ShouldHaveValidationErrorFor(x => x.Quality).WithErrorMessage(Errors.Thumbnails.ImageQualityMustBeBetweenZeroAndOneHundred.Description);
}
[Fact]
@@ -121,9 +121,8 @@ public class FluentValidationOptionsTests
// Assert
result.Should().BeOfType<ValidateOptionsResult>();
result.Failed.Should().BeTrue();
// TODO: should be modified to account for translation of error messages
result.Failures.Should().ContainSingle()
.Which.Should().Contain("Options validation failed for 'PropertyName' with error: 'Error Message'");
}
}
}