Skip to content

Increase Code Coverage#155

Merged
feO2x merged 4 commits into
mainfrom
155-increase-code-coverage
Jul 14, 2026
Merged

Increase Code Coverage#155
feO2x merged 4 commits into
mainfrom
155-increase-code-coverage

Conversation

@feO2x

@feO2x feO2x commented Jul 14, 2026

Copy link
Copy Markdown
Owner

Increases code coverage for the Light.GuardClauses project

feO2x added 2 commits July 14, 2026 20:30
Signed-off-by: Kenny Pflug <kenny.pflug@live.de>
Signed-off-by: Kenny Pflug <kenny.pflug@live.de>
@feO2x feO2x requested a review from Copilot July 14, 2026 19:25
@feO2x feO2x self-assigned this Jul 14, 2026
@feO2x feO2x added the chore label Jul 14, 2026
@github-actions

Copy link
Copy Markdown

Code Coverage

Package Line Rate Branch Rate Complexity Health
Light.GuardClauses 95% 88% 2336
Light.GuardClauses.InternalRoslynAnalyzers 96% 86% 52
Light.GuardClauses.InternalRoslynAnalyzers.CodeFixes 95% 100% 8
Light.GuardClauses.SourceCodeTransformation 92% 83% 663
Summary 94% (4445 / 4715) 87% (2397 / 2757) 3059

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR increases test coverage across Light.GuardClauses by adding/expanding unit tests for guard clause overloads (including span/memory buffer shapes) and several framework extension helpers, and by documenting test-writing expectations.

Changes:

  • Added new tests to cover additional success/failure paths and “factory not invoked on success” scenarios across string/numeric/buffer guard clauses.
  • Added new tests for framework extension helpers (text/exception message formatting, enumerable counting, hash generation, string representations).
  • Introduced test guidelines documentation and linked it from the root AGENTS.md; added solution items for easier discovery.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
tests/Light.GuardClauses.Tests/StringAssertions/MustNotStartWithTests.cs Adds span overload coverage and additional factory/success+failure path assertions.
tests/Light.GuardClauses.Tests/StringAssertions/MustBeEmailAddressTests.cs Adjusts existing tests and adds buffer-overload success-path coverage.
tests/Light.GuardClauses.Tests/StringAssertions/AsciiTests.cs Expands ASCII validation tests, including “factory not invoked” success-path checks.
tests/Light.GuardClauses.Tests/FrameworkExtensions/ToStringRepresentationTests.cs Adds coverage for primitive/unquoted handling, nulls, and representation edge cases.
tests/Light.GuardClauses.Tests/FrameworkExtensions/TextExtensionsTests.cs Adds coverage for exception message aggregation and whitespace-ignoring equality.
tests/Light.GuardClauses.Tests/FrameworkExtensions/MultiplyAddHashTests.cs Adds coverage ensuring all supported CreateHashCode arities match the builder behavior.
tests/Light.GuardClauses.Tests/FrameworkExtensions/EnumerableCountTests.cs Adds coverage for optimized counting strategies and enumeration behavior.
tests/Light.GuardClauses.Tests/ComparableAssertions/NumericCustomFactorySuccessTests.cs Adds coverage that custom factories are not invoked on numeric success paths.
tests/AGENTS.md Introduces explicit test-writing rules and how to run coverage.
Light.GuardClauses.slnx Adds solution items to surface new build/test guidance files.
AGENTS.md Links root guidance to the new test-specific guidance document.
Comments suppressed due to low confidence (1)

tests/Light.GuardClauses.Tests/StringAssertions/MustBeEmailAddressTests.cs:38

  • This test is named InvalidEmailAddressArgumentName but it no longer asserts the exception's ParamName; it currently duplicates InvalidEmailAddress by only checking the message. Asserting ParamName here makes the intent explicit and prevents regressions in argument-name handling.
        act.Should().Throw<InvalidEmailAddressException>()
           .And.Message.Should().Contain(
                $"emailAddress must be a valid email address, but it actually is \"{emailAddress}\"."
            );
    }

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/Light.GuardClauses.Tests/StringAssertions/MustBeEmailAddressTests.cs Outdated
Comment thread tests/Light.GuardClauses.Tests/StringAssertions/MustBeEmailAddressTests.cs Outdated
Comment thread tests/Light.GuardClauses.Tests/StringAssertions/MustBeEmailAddressTests.cs Outdated
Comment thread tests/Light.GuardClauses.Tests/StringAssertions/MustBeEmailAddressTests.cs Outdated
Comment thread Light.GuardClauses.slnx Outdated
Comment thread Light.GuardClauses.slnx Outdated
feO2x added 2 commits July 14, 2026 21:35
Signed-off-by: Kenny Pflug <kenny.pflug@live.de>
Signed-off-by: Kenny Pflug <kenny.pflug@live.de>
@feO2x feO2x merged commit fdc29d8 into main Jul 14, 2026
2 checks passed
@feO2x feO2x deleted the 155-increase-code-coverage branch July 14, 2026 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants