C5: dedent test class to match file-scoped namespace convention (closes #92, #93)#133
Merged
Merged
Conversation
The test file converted to file-scoped namespace ('namespace X;') but
the class body kept the old block-namespace indentation (4 spaces for
the class, 8 for members). Under file-scoped namespaces, contents
belong at column 0 with members at 4 spaces.
Pure whitespace change — no behavior or test count change.
Code-review pass otherwise found no issues:
- Public surface (IsBetween / IsInRange): full XML docs, correct
ArgumentNullException, multi-line argument lists in CLAUDE.md
Allman style, file-scoped namespace, 3 blank lines between members
- Tests: all assert, all named per the MethodName_when_x_y_z pattern,
cover bounds (lower / upper / inverted / equal-bounds), cover null
value, cover int/DateTime/string/char value types
- No dead code in src/, tests/, or examples/
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
Code-review (C5) pass on IComparable-Extensions, plus the dead-code
sweep (#93). Whitespace-only fix this PR; the rest of the audit had
no findings worth a change.
What changed
tests/Wolfgang.Extensions.IComparable.Tests.Unit/IComparableExtensionsTests.cs— class + members dedented by 4 spaces. The file uses a file-scoped
namespace (
namespace X;) but the class kept block-namespaceindentation. The fix is pure whitespace.
Audit findings
Source (
src/.../IComparableExtensions.cs, 74 LOC) — cleanIsBetween<T>,IsInRange<T>) have completeXML docs with
<summary>,<param>,<returns>,<exception>ArgumentNullException(nameof(value))whenvalueisnullparen on its own line, each arg indented, closing paren on its own
line)
async, no allocations in tight loops, no string concat, noLINQ chains — there's nothing tight to optimize in a CompareTo
wrapper
Tests (190 LOC) — clean apart from indentation
MethodName_when_condition_expected_resultnamingoutside-low, outside-high, equal-bounds, inverted-bounds, null-value
Tshapes:int,DateTime,string,charDead code (#93)
src/has 2 public methods, both used by tests — no dead surfacetests/has 16 public[Fact]/[Theory]methods, no privatehelpers, no unused symbols
examples/has twoProgram.Mainmethods (net462 + net8) — boththe entry points, neither dead
Closing #93 as "no dead code found" via this PR's Closes line.
Possible future work (out of scope for this PR)
lowerBoundorupperBoundisnull— current code defers toT'sCompareTocontract(
string.CompareTo(null)returns positive, soIsBetween(null, "z")is
true). Worth a follow-up issue if you want that contractformalized.
IComparable<T>test (e.g. aMoneyrecord) — theREADME rewrite in D2/D-readme: rewrite the stub README into a real one (closes #118, #102) #131 shows this usage, but no test exists.
Low priority since
int/DateTime/string/charalready exercisegeneric dispatch.
Stacked on vNext (PR #129).