Refs #159: migrate SQLite.Tests + Memory.Integration.Tests + IntegrationTests.Shared to MSTest (Phase 3 PR B)#173
Conversation
…rom SQLite.Tests Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…Back.cs to MSTest assertions Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
NotBeNullOrEmpty split by receiver type: string->IsNullOrEmpty, byte[]->length check. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…tegration.Tests csproj Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…cs to MSTest assertions Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…onTests.Shared csproj All 13 downstream consumers own their own FA ref; validated by full-solution build. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
📝 WalkthroughWalkthroughThis PR removes the FluentAssertions dependency from multiple test projects and converts assertions to MSTest's Assert API across shared integration test helpers, cancellation, consumer rollback, and dashboard query tests. One project swaps FluentAssertions for CompareNETObjects instead. ChangesFluentAssertions removal and MSTest migration
Estimated code review effort: 2 (Simple) | ~15 minutes Possibly related issues
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
Source/DotNetWorkQueue.Transport.Memory.Integration.Tests/Dashboard/DashboardQueries.cs (1)
360-362: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueConsider splitting combined null/length checks for clearer failure diagnostics.
Assert.IsTrue(body.Body != null && body.Body.Length > 0)collapses two conditions into one; on failure MSTest can't tell you whether it was null or empty. SeparateAssert.IsNotNull+ length check would give clearer failure messages.♻️ Proposed refactor
- Assert.IsNotNull(body); - Assert.IsTrue(body.Body != null && body.Body.Length > 0); - Assert.IsTrue(body.Headers != null && body.Headers.Length > 0); + Assert.IsNotNull(body); + Assert.IsNotNull(body.Body); + Assert.IsTrue(body.Body.Length > 0); + Assert.IsNotNull(body.Headers); + Assert.IsTrue(body.Headers.Length > 0);Also applies to: 388-389
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@Source/DotNetWorkQueue.Transport.Memory.Integration.Tests/Dashboard/DashboardQueries.cs` around lines 360 - 362, The test assertions in DashboardQueries are combining null and length checks into a single Assert.IsTrue, which hides whether the failure was caused by a null value or an empty array. Update the checks around body.Body and body.Headers to use separate Assert.IsNotNull and length assertions so MSTest reports clearer failures, and apply the same refactor in both locations mentioned.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In
`@Source/DotNetWorkQueue.Transport.Memory.Integration.Tests/Dashboard/DashboardQueries.cs`:
- Around line 360-362: The test assertions in DashboardQueries are combining
null and length checks into a single Assert.IsTrue, which hides whether the
failure was caused by a null value or an empty array. Update the checks around
body.Body and body.Headers to use separate Assert.IsNotNull and length
assertions so MSTest reports clearer failures, and apply the same refactor in
both locations mentioned.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: b9967044-1bda-44ec-b7ab-bb0469b88775
📒 Files selected for processing (9)
Source/DotNetWorkQueue.IntegrationTests.Shared/DotNetWorkQueue.IntegrationTests.Shared.csprojSource/DotNetWorkQueue.IntegrationTests.Shared/JobScheduler/JobSchedulerTestsShared.csSource/DotNetWorkQueue.IntegrationTests.Shared/LoggerShared.csSource/DotNetWorkQueue.Transport.Memory.Integration.Tests/Cancellation/MessageCancellationTests.csSource/DotNetWorkQueue.Transport.Memory.Integration.Tests/Consumer/ConsumerRollBack.csSource/DotNetWorkQueue.Transport.Memory.Integration.Tests/Dashboard/DashboardQueries.csSource/DotNetWorkQueue.Transport.Memory.Integration.Tests/DotNetWorkQueue.Transport.Memory.Integration.Tests.csprojSource/DotNetWorkQueue.Transport.SQLite.Tests/Basic/CommandHandler/SetJobLastKnownEventCommandHandlerTests.csSource/DotNetWorkQueue.Transport.SQLite.Tests/DotNetWorkQueue.Transport.SQLite.Tests.csproj
💤 Files with no reviewable changes (4)
- Source/DotNetWorkQueue.IntegrationTests.Shared/DotNetWorkQueue.IntegrationTests.Shared.csproj
- Source/DotNetWorkQueue.Transport.Memory.Integration.Tests/DotNetWorkQueue.Transport.Memory.Integration.Tests.csproj
- Source/DotNetWorkQueue.Transport.SQLite.Tests/Basic/CommandHandler/SetJobLastKnownEventCommandHandlerTests.cs
- Source/DotNetWorkQueue.Transport.SQLite.Tests/DotNetWorkQueue.Transport.SQLite.Tests.csproj
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #173 +/- ##
=======================================
Coverage 87.49% 87.49%
=======================================
Files 1023 1023
Lines 33863 33863
Branches 2864 2864
=======================================
+ Hits 29627 29628 +1
- Misses 3359 3362 +3
+ Partials 877 873 -4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|



Part of #159 (replace FluentAssertions with MSTest assertions). Phase 3, PR B of 2 — the three mechanical/trivial projects.
Projects
Transport.SQLite.Tests— 0.Should()sites; removes a deadusing FluentAssertions;+ theFluentAssertionsPackageReference.Transport.Memory.Integration.Tests— 64 sites acrossMessageCancellationTests.cs,ConsumerRollBack.cs,DashboardQueries.cs; removes FA ref.DotNetWorkQueue.IntegrationTests.Shared— 3 sites (LoggerShared.cs,JobScheduler/JobSchedulerTestsShared.cs); removes FA ref. This project isProjectReferenced by 13 integration test projects, all of which own their own FA ref, so removing it here is safe — validated by a full-solution build.Mapping notes
NotBeNullOrEmpty()split by receiver type: string →Assert.IsFalse(string.IsNullOrEmpty(x));byte[]→Assert.IsTrue(x != null && x.Length > 0).bool.Wait(...).Should().BeTrue(reason)→Assert.IsTrue(Wait(...), reason);BeGreaterThanOrEqualTo(1)→Assert.IsTrue(x >= 1).BeEmpty("...{0}", errors)→Assert.AreEqual(string.Empty, errors, $"...{errors}")(MSTest has no format-args overload).Verification
dotnet build Source/DotNetWorkQueue.sln -c Release→ 0 errors (proves the 13 IntegrationTests.Shared consumers still compile).dotnet test→ SQLite.Tests 146/146, Memory.Integration.Tests 57/57.FluentAssertions/.Should()across all three projects → zero.Source/Directory.Packages.propsFA entry intentionally left in place (removed in the final Replace FluentAssertions with MSTest assertions (license: 6.12.2 is last MIT release) #159 phase).Test-only; no production code change, no version bump.
🤖 Generated with Claude Code
Summary by CodeRabbit