Refs #159: migrate Dashboard.Api.Tests to MSTest assertions (Phase 5)#175
Conversation
…ssertions Plan 1.1 (#159): 9 files, 76 sites. Throws -> Assert.Throws<T>; WithMessage -> ex.Message.Contains(..., OrdinalIgnoreCase). No helper needed. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… assertions Plan 1.2 (#159): 5 files. BeOfType -> IsInstanceOfType; .Subject -> cast. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…Test assertions Plan 1.3 (#159): 8 files incl. 91-site DashboardServiceTests. Async ThrowAsync -> Assert.ThrowsAsync; BeEquivalentTo -> CollectionAssert.AreEquivalent; InterceptorChain Contain -> CollectionAssert.Contains, string Contain -> StringAssert.Contains. Swapped FluentAssertions.dll preload fixture -> Newtonsoft.Json.dll (survives FA removal). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…board.Api.Tests csproj Plan 1.4 (#159): project is FA-free (216/216 green net10+net8, Release 0/0, grep-zero). Directory.Packages.props untouched (FA pin removed solution-wide in Phase 8). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (23)
💤 Files with no reviewable changes (1)
📝 WalkthroughWalkthroughThis PR migrates the DotNetWorkQueue.Dashboard.Api.Tests project's assertion library from FluentAssertions to MSTest's built-in Assert, StringAssert, and CollectionAssert APIs across all test files, and removes the FluentAssertions package reference from the project file. No production code or public API declarations are changed. ChangesTest Framework Migration
Estimated code review effort: 2 (Simple) | ~15 minutes Possibly related issues
Possibly related PRs
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 |
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #175 +/- ##
==========================================
+ Coverage 87.40% 87.44% +0.03%
==========================================
Files 1024 1024
Lines 33905 33905
Branches 2870 2870
==========================================
+ Hits 29635 29647 +12
+ Misses 3391 3383 -8
+ Partials 879 875 -4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|



Part of #159 (replace FluentAssertions with MSTest assertions), Milestone 2, Phase 5.
Migrates all 22 files in
DotNetWorkQueue.Dashboard.Api.Tests(352.Should()sites) off FluentAssertions to built-in MSTest assertions, and removes the project's FAPackageReference. Test-only; no production code, no version bump.Scope
Configuration/(5) +Models/(4) — includes 6 throws + all 3WithMessagesitesControllers/(3) +Middleware/(2) —BeOfType/.SubjectchainsServices/(3, incl. 91-siteDashboardServiceTests) +Extensions/(4) + rootDashboardApiTests.csMapping notes
.Should().Throw<T>()→Assert.Throws<T>(T-or-derived); async →await Assert.ThrowsAsync<T>.WithMessage("*sub*")→ capture ex,Assert.IsTrue(ex.Message.Contains("sub", StringComparison.OrdinalIgnoreCase))(FAWithMessageis case-insensitive).Should().BeEquivalentTo(arr)(CORS origins, string collection) →CollectionAssert.AreEquivalent— noTests.Sharedhelper needed (no object-graph equivalence in this project)InterceptorChainContain→CollectionAssert.Contains; stringContain→StringAssert.ContainsBeOfType<T>()→Assert.IsInstanceOfType<T>;.Subject→ castFluentAssertions.dllpreload test fixture inDashboardExtensionsTeststoNewtonsoft.Json.dll(the copied DLL must still exist inbinafter FA is removed)Verification
TreatWarningsAsErrors): 0 warnings / 0 errors (net10.0 + net8.0)FluentAssertions/.Should()in the projectdotnet test: 216 / 216 passed on both TFMs (clean, FA-free build)Source/Directory.Packages.propsuntouched — FA pin removed solution-wide in Phase 8🤖 Generated with Claude Code
Summary by CodeRabbit