Skip to content

feat: add unit test project for Credfeto.Enumeration.Source.Generation.Generics#103

Open
dnyw4l3n13 wants to merge 3 commits into
mainfrom
feature/99-generics-unit-tests
Open

feat: add unit test project for Credfeto.Enumeration.Source.Generation.Generics#103
dnyw4l3n13 wants to merge 3 commits into
mainfrom
feature/99-generics-unit-tests

Conversation

@dnyw4l3n13
Copy link
Copy Markdown
Collaborator

Summary

  • Creates Credfeto.Enumeration.Source.Generation.Generics.Tests unit test project
  • Achieves 100% line, branch, and method coverage for EnumHelpers
  • Covers all six public methods: GetNameReflection, GetName, GetDescriptionReflection, GetDescription, IsDefinedReflection, IsDefined
  • Both cache-miss and cache-hit paths covered for GetName, GetDescription, and IsDefined
  • GetDescriptionReflection tested with a value with a [Description] attribute, without one, and with an undefined enum value (null field info path)
  • Adds TestEnumWithDescription enum in the test project for parameterised tests

Closes #99

@dnyw4l3n13 dnyw4l3n13 self-assigned this Jun 3, 2026
@dnyw4l3n13 dnyw4l3n13 added C# C# Source Files credfeto-enumeration-source-generation-generics Changes in Credfeto.Enumeration.Source.Generation.Generics project Unit Tests Unit test and integration test projects AI-Work Work for an AI Agent Urgent Urgent Priority labels Jun 3, 2026
@credfeto credfeto removed C# C# Source Files credfeto-enumeration-source-generation-generics Changes in Credfeto.Enumeration.Source.Generation.Generics project Unit Tests Unit test and integration test projects labels Jun 3, 2026
@dnyw4l3n13 dnyw4l3n13 added C# C# Source Files credfeto-enumeration-source-generation-generics Changes in Credfeto.Enumeration.Source.Generation.Generics project Unit Tests Unit test and integration test projects labels Jun 3, 2026
@dnyw4l3n13 dnyw4l3n13 marked this pull request as ready for review June 3, 2026 20:11
@credfeto credfeto removed C# C# Source Files credfeto-enumeration-source-generation-generics Changes in Credfeto.Enumeration.Source.Generation.Generics project Unit Tests Unit test and integration test projects labels Jun 3, 2026
@dnyw4l3n13
Copy link
Copy Markdown
Collaborator Author

Code review complete — two findings fixed before marking ready:

  1. UTF-8 BOM in EnumGetDescriptionTests.cs — removed in 11946db. The file had a BOM byte sequence (ef bb bf) at the start that was absent from all other source files in the project.

  2. Weak cache-hit assertions in EnumGetDescriptionTests.cs — fixed in 11946db. The GetDescriptionReturnsCachedNameWhenNoDescriptionAttribute and GetDescriptionReturnsCachedDescriptionWhenAttributePresent tests previously asserted secondResult == firstResult rather than asserting both against the expected literal. Updated both to match the EnumGetNameTests pattern.

Final state:

  • 32 tests pass on net9.0 and net10.0
  • 92 total solution tests pass
  • 100% line / branch / method coverage for Credfeto.Enumeration.Source.Generation.Generics
  • CI Build: Pre-Release ✅

@dnyw4l3n13 dnyw4l3n13 added C# C# Source Files credfeto-enumeration-source-generation-generics Changes in Credfeto.Enumeration.Source.Generation.Generics project Unit Tests Unit test and integration test projects labels Jun 3, 2026
@credfeto
Copy link
Copy Markdown
Owner

credfeto commented Jun 3, 2026

Super-linter summary

Language Validation result

All files and directories linted successfully

For more information, see the GitHub Actions workflow run

Powered by Super-linter

@dnyw4l3n13
Copy link
Copy Markdown
Collaborator Author

All CI checks pass. PR is ready for merge.

CI summary:

  • build-pre-release
  • lint-code
  • valid-changelog
  • change-log-entry-is-in-unreleased
  • include-changelog-entry
  • does-not-contain-secrets
  • dependency-review
  • has-no-merge-conflicts
  • All other lint and requirements checks ✅

No open review comments, no outstanding work.

@dnyw4l3n13
Copy link
Copy Markdown
Collaborator Author

Checked in on PR status — nothing has changed since the last session.

All CI checks still pass, no review comments to address, branch is up to date with main. PR remains ready for merge.

@dnyw4l3n13 dnyw4l3n13 marked this pull request as draft June 5, 2026 15:51
…n.Generics

Achieves 100% line, branch, and method coverage for EnumHelpers, covering
GetNameReflection, GetName (cache-miss and cache-hit), GetDescriptionReflection
(with and without Description attribute, and for undefined values), GetDescription,
IsDefinedReflection, and IsDefined.

Prompt: Work on issue #99 in credfeto/credfeto-enum-source-generation. Create unit test project for Credfeto.Enumeration.Source.Generation.Generics to achieve 100% code coverage.
Remove the UTF-8 BOM from EnumGetDescriptionTests.cs that was added by a
formatter, and update both cache-hit assertions to verify the expected literal
value directly rather than comparing against the first result only.
@dnyw4l3n13 dnyw4l3n13 force-pushed the feature/99-generics-unit-tests branch from 11946db to c1573aa Compare June 5, 2026 15:52
@dnyw4l3n13
Copy link
Copy Markdown
Collaborator Author

Rebased onto origin/main (16 commits — AI instruction file updates and GitHub Actions workflow updates). Force-pushed as c1573aa0. Waiting for CI to pass before marking ready.

@dnyw4l3n13 dnyw4l3n13 marked this pull request as ready for review June 5, 2026 16:05
@dnyw4l3n13
Copy link
Copy Markdown
Collaborator Author

PR marked ready. New CI run triggered — Apply Template and Generate Description is pending; lint and validation checks are expected to follow.

Stopping here per CI policy. Will resume automatically when checks complete.

@credfeto
Copy link
Copy Markdown
Owner

credfeto commented Jun 5, 2026

Super-linter summary

Language Validation result

All files and directories linted successfully

For more information, see the GitHub Actions workflow run

Powered by Super-linter

@dnyw4l3n13
Copy link
Copy Markdown
Collaborator Author

All CI checks passed after the rebase onto origin/main. PR is ready for merge.

  • build-pre-release
  • lint-code
  • valid-changelog
  • change-log-entry-is-in-unreleased
  • include-changelog-entry
  • does-not-contain-secrets
  • dependency-review
  • has-no-merge-conflicts
  • no-merge-commits
  • no-ignored-files
  • Check Not Draft
  • Copilot Code Review

No open review comments, no outstanding work.

@dnyw4l3n13
Copy link
Copy Markdown
Collaborator Author

All CI checks continue to pass and no new review comments have arrived. No further action required — PR is ready for merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI-Work Work for an AI Agent C# C# Source Files credfeto-enumeration-source-generation-generics Changes in Credfeto.Enumeration.Source.Generation.Generics project Unit Tests Unit test and integration test projects Urgent Urgent Priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Increase unit test coverage to 100% for Credfeto.Enumeration.Source.Generation.Generics

2 participants