Skip to content

Refs #159: migrate Transport.LiteDb.Tests to MSTest assertions (Phase 3 PR A)#172

Merged
blehnen merged 6 commits into
masterfrom
phase-3-litedb-tests
Jul 2, 2026
Merged

Refs #159: migrate Transport.LiteDb.Tests to MSTest assertions (Phase 3 PR A)#172
blehnen merged 6 commits into
masterfrom
phase-3-litedb-tests

Conversation

@blehnen

@blehnen blehnen commented Jul 2, 2026

Copy link
Copy Markdown
Owner

Part of #159 (replace FluentAssertions with MSTest assertions). Phase 3, PR A of 2.

Migrates DotNetWorkQueue.Transport.LiteDb.Tests (77 .Should() sites across 5 files) from FluentAssertions to built-in MSTest assertions and removes the project's FluentAssertions PackageReference. Adds a ProjectReference to DotNetWorkQueue.Tests.Shared for the one non-1:1 pattern.

Files

  • Basic/QueryMessageHistoryHandlerTests.cs (4)
  • Basic/QueryHandler/DoesJobExistQueryHandlerTests.cs (7)
  • Basic/QueryHandler/GetJobIdQueryHandlerTests.cs (4)
  • Basic/CommandHandler/SetJobLastKnownEventCommandHandlerTests.cs (13)
  • Basic/WriteMessageHistoryHandlerTests.cs (49)
  • csproj: +Tests.Shared ProjectReference, −FluentAssertions

Mapping notes

  • Expected-first Assert.AreEqual; .Should().Be(x)AreEqual, HaveCount(n)AreEqual(n, .Count), NotBeNull/BeNullIsNotNull/IsNull.
  • BeEquivalentTo(byte[])AssertHelper.AreEquivalent (order-insensitive, matches FA default).
  • BeGreaterThan(0)/BeGreaterThanOrEqualTo(0)Assert.IsTrue(x > 0)/(x >= 0).
  • NotThrow() → bare act();.

Verification

Test-only; no production code change, no version bump.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Tests
    • Updated test assertions to use the built-in test framework consistently.
    • Added broader coverage helpers for comparing complex values in history-related tests.
    • Removed an unused test dependency and adjusted test project references accordingly.

blehnen and others added 6 commits July 2, 2026 09:40
…st assertions

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… assertions

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ertions

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… LiteDb.Tests csproj

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ests.cs to MSTest assertions

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…st assertions

Includes AssertHelper.AreEquivalent for the 2 byte[] BeEquivalentTo sites and
Assert.IsTrue for BeGreaterThan/BeGreaterThanOrEqualTo.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c63f4886-e07f-4d24-9dc4-287e5390127f

📥 Commits

Reviewing files that changed from the base of the PR and between ef9d7d5 and 9d68d5e.

📒 Files selected for processing (6)
  • Source/DotNetWorkQueue.Transport.LiteDb.Tests/Basic/CommandHandler/SetJobLastKnownEventCommandHandlerTests.cs
  • Source/DotNetWorkQueue.Transport.LiteDb.Tests/Basic/QueryHandler/DoesJobExistQueryHandlerTests.cs
  • Source/DotNetWorkQueue.Transport.LiteDb.Tests/Basic/QueryHandler/GetJobIdQueryHandlerTests.cs
  • Source/DotNetWorkQueue.Transport.LiteDb.Tests/Basic/QueryMessageHistoryHandlerTests.cs
  • Source/DotNetWorkQueue.Transport.LiteDb.Tests/Basic/WriteMessageHistoryHandlerTests.cs
  • Source/DotNetWorkQueue.Transport.LiteDb.Tests/DotNetWorkQueue.Transport.LiteDb.Tests.csproj

📝 Walkthrough

Walkthrough

This PR migrates test assertions in the LiteDb transport test project from FluentAssertions to MSTest's built-in Assert API. It removes FluentAssertions imports, rewrites assertion calls, adds a shared test utilities project reference, and removes the FluentAssertions package dependency.

Changes

LiteDb Test Assertion Migration

Layer / File(s) Summary
Command handler test migration
Basic/CommandHandler/SetJobLastKnownEventCommandHandlerTests.cs
FluentAssertions import removed and job insert/update/count assertions rewritten to MSTest `Assert.AreEqual`.
Query handler test migration
Basic/QueryHandler/DoesJobExistQueryHandlerTests.cs, Basic/QueryHandler/GetJobIdQueryHandlerTests.cs
Status and job-id result assertions across multiple test methods converted from `.Should().Be(...)` to `Assert.AreEqual(...)`.
Message history query test migration
Basic/QueryMessageHistoryHandlerTests.cs
Null and duration assertions rewritten using `Assert.IsNotNull`, `Assert.AreEqual`, and `Assert.IsNull`.
Message history write lifecycle test migration
Basic/WriteMessageHistoryHandlerTests.cs
Enqueue, processing, complete, error, rollback, delete, expire, and full-lifecycle assertions rewritten to MSTest calls; body/header comparisons use `AssertHelper.AreEquivalent`; "no throw" checks replaced with direct action invocation.
Project reference and package updates
DotNetWorkQueue.Transport.LiteDb.Tests.csproj
Adds a project reference to `DotNetWorkQueue.Tests.Shared` and removes the `FluentAssertions` package reference.

Estimated code review effort: 2 (Simple) | ~15 minutes

Possibly related issues

Poem

A bunny hopped through lines of test,
Swapped "Should().Be" for MSTest's best,
No throw? Just run it, plain and true,
FluentAssertions bids adieu,
Shared helpers now join the nest 🐰✅

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and accurately summarizes the main change: migrating Transport.LiteDb.Tests to MSTest assertions.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sonarqubecloud

sonarqubecloud Bot commented Jul 2, 2026

Copy link
Copy Markdown

@blehnen blehnen merged commit 4abb8a0 into master Jul 2, 2026
3 of 4 checks passed
@blehnen blehnen deleted the phase-3-litedb-tests branch July 2, 2026 18:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant