Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ public async Task DeleteByDocumentIdAsync(
Guid documentId,
CancellationToken cancellationToken = default)
{
await _dbSet
.Where(c => c.DocumentId == documentId)
.ExecuteDeleteAsync(cancellationToken);
await RelationalQueryableExtensions.ExecuteDeleteAsync(
_dbSet.Where(c => c.DocumentId == documentId),
cancellationToken);
}
}
2 changes: 1 addition & 1 deletion backend/tests/Taskdeck.Api.Tests/ArchiveApiTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public async Task GetArchiveItems_WithLimit_ShouldRespectLimit()

var items = await response.Content.ReadFromJsonAsync<List<ArchiveItemDto>>();
items.Should().NotBeNull();
items!.Count.Should().BeLessOrEqualTo(5);
items!.Count.Should().BeLessThanOrEqualTo(5);
}

[Fact]
Expand Down
4 changes: 2 additions & 2 deletions backend/tests/Taskdeck.Api.Tests/HealthApiTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public async Task Ready_ShouldExcludeCaptureBacklogFromAutomationQueueDepth()
var payload = await response.Content.ReadFromJsonAsync<JsonElement>();
var queue = payload.GetProperty("checks").GetProperty("queue");
queue.GetProperty("depth").GetInt32().Should().Be(0);
queue.GetProperty("captureDepth").GetInt32().Should().BeGreaterOrEqualTo(3);
queue.GetProperty("totalDepth").GetInt32().Should().BeGreaterOrEqualTo(3);
queue.GetProperty("captureDepth").GetInt32().Should().BeGreaterThanOrEqualTo(3);
queue.GetProperty("totalDepth").GetInt32().Should().BeGreaterThanOrEqualTo(3);
}
}
2 changes: 1 addition & 1 deletion backend/tests/Taskdeck.Api.Tests/LlmQuotaApiTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public async Task GetKillSwitch_ShouldReturnStatus()
var json = JsonSerializer.Deserialize<JsonElement>(body);
json.TryGetProperty("globalKilled", out _).Should().BeTrue();
json.TryGetProperty("entries", out var entries).Should().BeTrue();
entries.GetArrayLength().Should().BeGreaterOrEqualTo(1);
entries.GetArrayLength().Should().BeGreaterThanOrEqualTo(1);
}

[Fact]
Expand Down
8 changes: 4 additions & 4 deletions backend/tests/Taskdeck.Api.Tests/LlmQuotaIntegrationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -306,9 +306,9 @@ public async Task UsageSummary_ShouldReflectRecordedUsage()
var usage = await usageResponse.Content.ReadFromJsonAsync<JsonElement>();

usage.GetProperty("totalRequests").GetInt64().Should().Be(messageCount);
usage.GetProperty("totalTokens").GetInt64().Should().BeGreaterOrEqualTo(0);
usage.GetProperty("totalInputTokens").GetInt64().Should().BeGreaterOrEqualTo(0);
usage.GetProperty("totalOutputTokens").GetInt64().Should().BeGreaterOrEqualTo(0);
usage.GetProperty("totalTokens").GetInt64().Should().BeGreaterThanOrEqualTo(0);
usage.GetProperty("totalInputTokens").GetInt64().Should().BeGreaterThanOrEqualTo(0);
usage.GetProperty("totalOutputTokens").GetInt64().Should().BeGreaterThanOrEqualTo(0);

// Verify window boundaries are present
usage.TryGetProperty("windowStart", out _).Should().BeTrue();
Expand Down Expand Up @@ -342,7 +342,7 @@ public async Task QuotaStatus_ShouldReturnCorrectRemainingCounts()
afterResponse.StatusCode.Should().Be(HttpStatusCode.OK);
var after = await afterResponse.Content.ReadFromJsonAsync<JsonElement>();
after.GetProperty("requestsThisHour").GetInt64().Should().Be(1);
after.GetProperty("tokensUsedToday").GetInt64().Should().BeGreaterOrEqualTo(0);
after.GetProperty("tokensUsedToday").GetInt64().Should().BeGreaterThanOrEqualTo(0);
}
}

Expand Down
2 changes: 1 addition & 1 deletion backend/tests/Taskdeck.Api.Tests/OpsCliApiTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public async Task RunCommand_ShouldFallbackCorrelationId_WhenRequestCorrelationH
var payload = await response.Content.ReadFromJsonAsync<CommandRunDto>();
payload.Should().NotBeNull();
payload!.CorrelationId.Should().NotBe(invalidCorrelationId);
payload.CorrelationId.Length.Should().BeLessOrEqualTo(100);
payload.CorrelationId.Length.Should().BeLessThanOrEqualTo(100);

response.Headers.TryGetValues("X-Request-Id", out var responseRequestIds).Should().BeTrue();
responseRequestIds!.Single().Should().Be(payload.CorrelationId);
Expand Down
8 changes: 2 additions & 6 deletions backend/tests/Taskdeck.Api.Tests/Support/ApiTestHarness.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,8 @@ public static async Task AssertErrorContractAsync(
}
catch (JsonException ex)
{
Execute.Assertion.FailWith(
"Expected a JSON error contract body for {0}, but parsing failed: {1}. Body: {2}",
expectedStatus,
ex.Message,
rawBody);
return;
throw new XunitException(
$"Expected a JSON error contract body for {expectedStatus}, but parsing failed: {ex.Message}. Body: {rawBody}");
}

payload.ValueKind.Should().Be(JsonValueKind.Object);
Expand Down
Loading