fix(pr-review): resolve inline review comments regarding debounce race and result pattern

This commit is contained in:
2026-06-15 19:14:13 +02:00
parent b74ba4ba54
commit 8de02c32c5
6 changed files with 51 additions and 45 deletions
@@ -234,7 +234,7 @@ public class CreatorDashboardTests : IDisposable
}
[Fact]
public async Task GetBookRevisions_WithMismatchedUserOrTenant_ThrowsBookNotFoundException()
public async Task GetBookRevisions_WithMismatchedUserOrTenant_ReturnsFailure()
{
// Arrange
var userId = "creator-123";
@@ -262,12 +262,14 @@ public class CreatorDashboardTests : IDisposable
// Act & Assert
var queryMismatchedTenant = new GetBookRevisionsQuery(bookId, userId, "different-tenant");
var actionTenant = () => handler.Handle(queryMismatchedTenant, CancellationToken.None);
await actionTenant.Should().ThrowAsync<BookNotFoundException>();
var resultTenant = await handler.Handle(queryMismatchedTenant, CancellationToken.None);
resultTenant.IsSuccess.Should().BeFalse();
resultTenant.Errors.Should().Contain(e => e.Message.Contains("was not found"));
var queryMismatchedUser = new GetBookRevisionsQuery(bookId, "different-user", tenantId);
var actionUser = () => handler.Handle(queryMismatchedUser, CancellationToken.None);
await actionUser.Should().ThrowAsync<BookNotFoundException>();
var resultUser = await handler.Handle(queryMismatchedUser, CancellationToken.None);
resultUser.IsSuccess.Should().BeFalse();
resultUser.Errors.Should().Contain(e => e.Message.Contains("was not found"));
}
public void Dispose()