feat(Service Registration): Rename pipeline logger and expand docs and test coverage #breaking#8
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request introduces a breaking change by renaming the StartupLogger property to Logger in the ServiceRegistrationPipeline class for improved naming clarity. The PR also significantly enhances test coverage, refactors expression validation logic to reduce duplication, and expands documentation throughout the codebase and README.
Changes:
- Renamed
StartupLoggertoLoggerinServiceRegistrationPipelineand updated all references - Refactored expression validation logic to use shared
ValidateCoreandEnsureValidServiceCollectionExtensionmethods, makingIsExtensionMethodinternal for reuse - Added comprehensive test coverage for
ServiceRegistrationExpressionCollectionwith a new test file covering expression lifting, ordering guarantees, and validation behavior - Expanded XML documentation across all affected classes with detailed remarks sections, exception documentation, and usage examples
- Enhanced README with detailed guidance on configuring the pipeline logger, environment-aware logging patterns, and controlled opt-out scenarios
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
src/ServiceComposition.NET/ServiceRegistrationPipeline.cs |
Renamed StartupLogger property to Logger with enhanced documentation; refactored GetExpressionAsString to reuse IsExtensionMethod |
src/ServiceComposition.NET/ServiceRegistrationExpressionCollection.cs |
Enhanced XML documentation for all methods; added explicit null checks to AddRegistrations methods to match nullable parameters |
src/ServiceComposition.NET/ExpressionExtensions.cs |
Refactored validation logic into shared ValidateCore and EnsureValidServiceCollectionExtension methods; made IsExtensionMethod internal for reuse; improved documentation |
tst/ServiceComposition.NET.UnitTests/TestClasses/TestServiceRegistrationPipelineWithLogger.cs |
Updated override to use Logger property |
tst/ServiceComposition.NET.UnitTests/TestClasses/TestServiceRegistrationPipeline.cs |
Updated override to use Logger property |
tst/ServiceComposition.NET.UnitTests/ServiceRegistrationPipelineTests.cs |
Renamed test methods to reflect property rename; added tests for method call and type binary expression formatting |
tst/ServiceComposition.NET.UnitTests/ServiceRegistrationExpressionCollectionTests.cs |
New comprehensive test file covering expression lifting, validation, ordering, and null handling |
tst/ServiceComposition.NET.UnitTests/ExpressionExtensionTests.cs |
Enhanced tests for null handling, instance methods, and invocation expressions; corrected exception types from ArgumentException to ArgumentNullException |
tst/ServiceComposition.NET.IntegrationTests/TestClasses/TestServiceRegistrationPipeline.cs |
Updated override to use Logger property |
README.md |
Renamed examples from CoreServiceRegistrationPipeline to AppServiceRegistrationPipeline; added extensive sections on configuring the pipeline logger with Serilog examples and opt-out guidance |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| } | ||
|
|
||
| [Fact] | ||
| public void ValidateServiceRegistration_WithoutConfiguration__Throws_WhenMethodIsInstanceMethod() |
There was a problem hiding this comment.
The test method name contains a double underscore ("WithoutConfiguration__Throws"). This should be a single underscore to match the naming convention used by other test methods in this file.
| public void ValidateServiceRegistration_WithoutConfiguration__Throws_WhenMethodIsInstanceMethod() | |
| public void ValidateServiceRegistration_WithoutConfiguration_Throws_WhenMethodIsInstanceMethod() |
522ce85 to
36fdc8e
Compare
…d test coverage #breaking Refined the service registration pipeline for clarity, consistency, and reliability. Pipeline: - Renamed StartupLogger to Logger in ServiceRegistrationPipeline for clearer abstraction and naming consistency while preserving startup-safe logging semantics (no DI dependency required) Validation: - Refactored expression validation logic to reduce duplication and improve internal reuse (no behavioral changes) Documentation: - Expanded and clarified XML documentation for expression validation invariants, canonical expression normalization, and execution semantics including ordering guarantees - Added README guidance for configuring the pipeline logger, environment-aware logging, and controlled opt-out scenarios Testing: - Increased unit test coverage for invocation expressions, instance methods, invalid extension targets, expression lifting behavior, and expression string formatting (including method call and type binary arguments) - Strengthened log message assertions to verify formatted output explicitly BREAKING CHANGE: - `StartupLogger` property renamed to `Logger` in `ServiceRegistrationPipeline`
36fdc8e to
a5a8505
Compare
|



Refined the service registration pipeline for clarity, consistency, and reliability.
Pipeline:
StartupLoggertoLoggerin ServiceRegistrationPipeline for clearer abstraction and naming consistency while preserving startup-safe logging semantics (no DI dependency required)Validation:
Documentation:
Testing:
BREAKING CHANGE:
StartupLoggerproperty renamed toLoggerin ServiceRegistrationPipeline