From 17c32e0d4950a9c70a236c51a3091b74e1cdc98a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Garstecki?= Date: Fri, 1 Dec 2023 13:42:03 +0100 Subject: [PATCH] Fix LowRatingUpperBoundInclusive handling --- backend/src/LeanCode.AppRating/Handlers/SubmitAppRatingCH.cs | 2 +- .../Tests/SubmitReviewTests.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/src/LeanCode.AppRating/Handlers/SubmitAppRatingCH.cs b/backend/src/LeanCode.AppRating/Handlers/SubmitAppRatingCH.cs index eff5c5f..4e9cbc8 100644 --- a/backend/src/LeanCode.AppRating/Handlers/SubmitAppRatingCH.cs +++ b/backend/src/LeanCode.AppRating/Handlers/SubmitAppRatingCH.cs @@ -76,7 +76,7 @@ public async Task ExecuteAsync(HttpContext context, SubmitAppRating command) ) ); - if (command.Rating < appRatingReportsConfiguration.LowRatingUpperBoundInclusive) + if (command.Rating <= appRatingReportsConfiguration.LowRatingUpperBoundInclusive) { await publishEndpoint.Publish( new LowRateSubmitted(userId, command.Rating, command.AdditionalComment), diff --git a/backend/tests/LeanCode.AppRating.IntegrationTests/Tests/SubmitReviewTests.cs b/backend/tests/LeanCode.AppRating.IntegrationTests/Tests/SubmitReviewTests.cs index 1311a5b..9b3c8fc 100644 --- a/backend/tests/LeanCode.AppRating.IntegrationTests/Tests/SubmitReviewTests.cs +++ b/backend/tests/LeanCode.AppRating.IntegrationTests/Tests/SubmitReviewTests.cs @@ -83,7 +83,7 @@ private async Task EnsureLowRatingSubmittedEmailSent() await App.Command.RunSuccessAsync( new SubmitAppRating { - Rating = 1.0, + Rating = 2.0, AdditionalComment = new string('a', 200), AppVersion = "1.23.456", Platform = PlatformDTO.Android,