Skip to content

[Feature] Consolidate duplicated ResourceLoader into shared Reporting implementation; fixes #44#71

Merged
samatstariongroup merged 1 commit into
developmentfrom
GH44
Jun 5, 2026
Merged

[Feature] Consolidate duplicated ResourceLoader into shared Reporting implementation; fixes #44#71
samatstariongroup merged 1 commit into
developmentfrom
GH44

Conversation

@samatstariongroup
Copy link
Copy Markdown
Member

@
Factors the duplicated embedded-resource loading logic out of ECoreNetto.Tools and ECoreNetto.Reporting into a single shared implementation.

Changes

  • ECoreNetto.Reporting/Resources/ResourceLoader.cs — now the single source of truth. Made public and changed the signature to LoadEmbeddedResource(Assembly assembly, string path). The Assembly is passed in explicitly so callers in other assemblies resolve resources from their own manifest (the reason the logic could not simply be shared as-is: Assembly.GetExecutingAssembly() would always return the Reporting assembly).
  • ECoreNetto.Reporting/Generators/HandleBarsReportGenerator.cs — the single caller now passes typeof(HandleBarsReportGenerator).Assembly, where the .hbs templates are embedded.
  • ECoreNetto.Tools/Resources/ResourceLoader.cs — removed the duplicated loading logic; LoadEmbeddedResource(string) now delegates to the shared loader, binding the Tools assembly. The Tools-specific QueryVersion/QueryLogo helpers stay put.

Acceptance criteria

  • Shared loading logic is not duplicated — one implementation in ECoreNetto.Reporting; project-specific helpers kept separate.

Verification

Solution builds clean (0 warnings/0 errors); the 4 ResourceLoaderTestFixture tests and all 23 Reporting tests pass. Public Tools API (LoadEmbeddedResource(string), QueryVersion, QueryLogo) is preserved, so no test changes were needed.

Closes #44
@

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 5, 2026

Package Line Rate Branch Rate Complexity Health
ECoreNetto 86% 78% 415
ECoreNetto.Extensions 99% 93% 101
ECoreNetto.HandleBars 99% 98% 60
ECoreNetto.Reporting 83% 71% 181
ECoreNetto.Tools 94% 89% 58
Summary 89% (2154 / 2426) 81% (493 / 608) 815

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Jun 5, 2026

@samatstariongroup samatstariongroup merged commit 5f1ee95 into development Jun 5, 2026
14 checks passed
@samatstariongroup samatstariongroup deleted the GH44 branch June 5, 2026 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Consolidate duplicated ResourceLoader

1 participant