Refs #159: migrate Dashboard.Client.Tests + Dashboard.Ui.Tests to MSTest assertions (Phase 4)#174
Conversation
3 files / 215 sites; remove FluentAssertions PackageReference. Throw<T>/ThrowAsync, ContainKey, HaveCount, StringAssert.Contains mappings. 92/92 tests green (net10+net8). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
10 files / 89 sites; remove FluentAssertions PackageReference. Throw().WithMessage chains -> capture ex + StringAssert.Contains(OrdinalIgnoreCase, matching FA's case-insensitive WithMessage); BeAssignableTo->IsInstanceOfType; BeSameAs/NotBeSameAs ->AreSame/AreNotSame; collection BeEmpty/NotBeEmpty->Assert.IsFalse/IsTrue(x.Any()); StringAssert.Contains/EndsWith for string Contain/EndWith. 66/66 tests green (net10+net8). 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 (15)
💤 Files with no reviewable changes (2)
📝 WalkthroughWalkthroughThis PR migrates test assertion logic across two test projects (Dashboard.Client.Tests and Dashboard.Ui.Tests) from FluentAssertions to MSTest-native Assert/StringAssert APIs, and removes the FluentAssertions package reference from both project files. No production code or public API signatures change. ChangesFluentAssertions to MSTest test 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 |
|



Part of #159 (replace FluentAssertions with MSTest assertions). Phase 4 — the two Dashboard unit-test projects, in one combined PR (single Jenkins build).
Migrates 304
.Should()sites across 13 files to built-in MSTest assertions and removes each project'sFluentAssertionsPackageReference. NoTests.Sharedhelper needed (noBeEquivalentTo/BeCloseTo/AllSatisfy).Projects
Dashboard.Client.Tests— 3 files, 215 sites (ModelTests,DashboardApiClientTests,DashboardConsumerClientTests).Dashboard.Ui.Tests— 10 files, 89 sites (bUnit/MudBlazor component tests + Services).Mapping notes
Be/BeTrue/BeFalse/BeNull/NotBeNull/HaveCount→Assert.AreEqual/IsTrue/IsFalse/IsNull/IsNotNull/AreEqual(n, x.Count)(expected-first).Throw<T>()→Assert.Throws<T>(act);ThrowAsync<T>→await Assert.ThrowsAsync<T>(act);NotThrow/NotThrowAsync→ bareact()/await act().Throw<T>().WithMessage("*X*")→var ex = Assert.Throws<T>(act); StringAssert.Contains(ex.Message, "X", StringComparison.OrdinalIgnoreCase)—OrdinalIgnoreCasepreserves FAWithMessage's case-insensitive matching.Contain/EndWith→StringAssert.Contains/EndsWith(case-sensitive, matching FAContain);NotContain→Assert.IsFalse(x.Contains(..)).ContainKey→ContainsKey; collectionBeEmpty/NotBeEmpty→Assert.IsFalse/IsTrue(x.Any());BeAssignableTo<T>→Assert.IsInstanceOfType(x, typeof(T));BeSameAs/NotBeSameAs→Assert.AreSame/AreNotSame;BeOnOrAfter→Assert.IsTrue(x >= y).Verification
dotnet build -c Release(TreatWarningsAsErrors) → 0 warnings, 0 errors (both projects).dotnet test -c Release→ Client 92/92, Ui 66/66, on both net10.0 and net8.0.FluentAssertions/.Should()across both projects' source → 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
Tests
Chores