Skip to content

Add functional coverage for generated registrations - #58

Merged
viceroypenguin merged 1 commit into
mainfrom
test/add-injections-functional-tests
Jul 26, 2026
Merged

Add functional coverage for generated registrations#58
viceroypenguin merged 1 commit into
mainfrom
test/add-injections-functional-tests

Conversation

@dukesteen

@dukesteen dukesteen commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Exercise service lifetimes, registration and duplicate strategies, keyed and factory services, open generics, tags, proxy identity, and RegisterServices callbacks against a real service provider.

Summary by CodeRabbit

  • Tests
    • Added functional coverage for duplicate registration strategies: append, skip, and replace.
    • Added validation for keyed service resolution and tag-based filtering.
    • Added coverage for singleton, scoped, and transient lifetimes.
    • Added tests for factory registrations, open generics, manual registrations, and registration strategies.
  • Chores
    • Removed an obsolete placeholder test.

Exercise service lifetimes, registration and duplicate strategies, keyed and factory services, open generics, tags, proxy identity, and RegisterServices callbacks against a real service provider.
@coderabbitai

coderabbitai Bot commented Jul 26, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: a9276fd8-da83-46ee-9b9f-37754b4921c8

📥 Commits

Reviewing files that changed from the base of the PR and between 7b240ee and abd3a89.

📒 Files selected for processing (10)
  • tests/Immediate.Injections.FunctionalTests/DuplicateStrategies/DuplicateStrategyTests.cs
  • tests/Immediate.Injections.FunctionalTests/Empty.cs
  • tests/Immediate.Injections.FunctionalTests/Factories/FactoryTests.cs
  • tests/Immediate.Injections.FunctionalTests/KeyedServices/KeyedServiceTests.cs
  • tests/Immediate.Injections.FunctionalTests/Lifetimes/LifetimeTests.cs
  • tests/Immediate.Injections.FunctionalTests/OpenGenerics/OpenGenericTests.cs
  • tests/Immediate.Injections.FunctionalTests/RegisterServices/RegisterServicesTests.cs
  • tests/Immediate.Injections.FunctionalTests/RegistrationStrategies/RegistrationStrategyTests.cs
  • tests/Immediate.Injections.FunctionalTests/ServiceProviderFactory.cs
  • tests/Immediate.Injections.FunctionalTests/Tags/TagTests.cs
💤 Files with no reviewable changes (1)
  • tests/Immediate.Injections.FunctionalTests/Empty.cs

📝 Walkthrough

Walkthrough

Adds functional DI tests for registration strategies, duplicate handling, factories, keys, tags, lifetimes, open generics, and manual registrations. Introduces a shared validated service-provider factory and removes the placeholder empty test.

Changes

Functional DI tests

Layer / File(s) Summary
Service-provider test harness
tests/Immediate.Injections.FunctionalTests/ServiceProviderFactory.cs
Adds shared provider construction with optional service configuration, generated test-service registration, and validation options.
Registration behavior coverage
tests/Immediate.Injections.FunctionalTests/RegistrationStrategies/RegistrationStrategyTests.cs, tests/Immediate.Injections.FunctionalTests/DuplicateStrategies/DuplicateStrategyTests.cs, tests/Immediate.Injections.FunctionalTests/Tags/TagTests.cs, tests/Immediate.Injections.FunctionalTests/KeyedServices/KeyedServiceTests.cs
Tests interface registration strategies, duplicate append/skip/replace behavior, tag filtering, and matching keyed resolution.
Factory and manual registration coverage
tests/Immediate.Injections.FunctionalTests/Factories/FactoryTests.cs, tests/Immediate.Injections.FunctionalTests/RegisterServices/RegisterServicesTests.cs
Tests factory-created services, dependency and key propagation, manual registration methods, and tag forwarding.
Resolution lifetime and generic coverage
tests/Immediate.Injections.FunctionalTests/Lifetimes/LifetimeTests.cs, tests/Immediate.Injections.FunctionalTests/OpenGenerics/OpenGenericTests.cs
Tests singleton, scoped, and transient instance behavior plus closed resolutions from open-generic registrations.

Estimated code review effort: 3 (Moderate) | ~25 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: adding functional test coverage for generated registrations.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch test/add-injections-functional-tests

Comment @coderabbitai help to get the list of available commands.

@viceroypenguin
viceroypenguin merged commit 1fef124 into main Jul 26, 2026
3 checks passed
@viceroypenguin
viceroypenguin deleted the test/add-injections-functional-tests branch July 26, 2026 19:51
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.

2 participants