Repository navigation
test: replace FluentAssertions with NUnit assertions - #28
Merged
Merged
Conversation
FluentAssertions was used in only six places. Use NUnit's Assert.That like the rest of the test suite and drop the dependency. The deep BeEquivalentTo comparisons now rely on value equality: Size, SpacePlan and Position are readonly structs, TextStyle is a record, and the test engine operations are turned into records. Since TextStyle members are internal, its test describes both styles in the failure message. Closes #15 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1fabi0
approved these changes
Oct 2, 2026
This was referenced Oct 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #15. Removes FluentAssertions and uses NUnit's
Assert.Thatthroughout, matching the rest of the test suite.FluentAssertions was only used in 6 places, so this is a small change:
FontStyleSetTests.Should().BeTrue()/BeFalse()Is.True/Is.FalseDynamicImageTestsBeEquivalentTo(new Size(...))Is.EqualTo(Sizeis a readonly struct)TestPlanmeasureBeEquivalentTo(expectedMeasure)Is.EqualTo(SpacePlanis a readonly struct)TestPlandraw opsBeEquivalentTo(..., PreferringRuntimeMemberTypes)Is.EqualToon the operation listTextStyleTestsBeEquivalentTo(..., IncludingNestedObjects, ...)Is.EqualTo(TextStyleis a record,Fallbackcompared recursively)GridTestsusingOperationBaseand its 9 subclasses (test engine only) are now records, which gives them value equality. Record equality also checks the runtime type, so it's slightly stricter thanBeEquivalentTo.Failure messages
ToString()prints every property, for exampleExpected: <CanvasTranslateOperation { Position = (Left: 1,000, Top: 0,000) }> But was: <... (Left: 0,000 ...)>TextStyle: its members areinternal, so the recordToString()printsTextStyle { }. The test now passes a message that lists all members of both styles.Verification
CanvasTranslateOperationby 1px fails the alignment testsFallback.HasUnderlinefailsApplyInheritedAndGlobalStyletest:commit, so merging does not trigger a release.🤖 Generated with Claude Code