-
Notifications
You must be signed in to change notification settings - Fork 1
Composition root project #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…c OS X Signed-off-by: Kenny Pflug <kenny.pflug@live.de>
Signed-off-by: Kenny Pflug <kenny.pflug@live.de>
… cannot be deleted Signed-off-by: Kenny Pflug <kenny.pflug@live.de>
Signed-off-by: Kenny Pflug <kenny.pflug@live.de>
Signed-off-by: Kenny Pflug <kenny.pflug@live.de>
Signed-off-by: Kenny Pflug <kenny.pflug@live.de>
Signed-off-by: Kenny Pflug <kenny.pflug@live.de>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Enhances Light.TemporaryStreams with Microsoft DI and logging support, reorganizes project files, and refines test configuration and coverage.
- Introduce
AddTemporaryStreamServiceDI extension andILoggererror‐logging helpers. - Centralize MSBuild settings via shared
Directory.Build.propsinsrcandtests. - Update and add tests for service registration, logging integration, and hashing.
Reviewed Changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/Light.TemporaryStreams/ServiceCollectionExtensions.cs | Register TemporaryStreamService and error handler in DI |
| src/Light.TemporaryStreams/MicrosoftLoggingExtensions.cs | Add LoggerMessage extensions for stream deletion errors |
| src/Directory.Build.props | Shared build props (documentation, AOT, namespace) |
| tests/Directory.Build.props | Shared test build props (test SDK, xunit, FluentAssertions) |
| tests/Light.TemporaryStreams.Tests/ServiceCollectionExtensionsTests.cs | Tests for DI registration and logging behavior |
| tests/Light.TemporaryStreams.Core.Tests/Light.TemporaryStreams.Core.Tests.csproj | Simplify csproj; now relies on centralized props |
| src/Light.TemporaryStreams.Core/Hashing/HashingPlugin.cs | Add cancellation check before wrapping streams |
| tests/Light.TemporaryStreams.Core.Tests/Hashing/CopyToHashCalculatorTests.cs | Change hash algorithm in test |
Comments suppressed due to low confidence (4)
tests/Light.TemporaryStreams.Tests/ServiceCollectionExtensionsTests.cs:37
- [nitpick] The test method name ends with 'When()' but doesn't specify the condition. Consider renaming to reflect the scenario, e.g., 'WhenLoggingDisabled'.
public async Task AddTemporaryStreamService_ShouldNotIncorporateMicrosoftLogging_When()
tests/Light.TemporaryStreams.Core.Tests/Light.TemporaryStreams.Core.Tests.csproj:3
- The test project no longer includes package references for test SDK and frameworks (e.g., Microsoft.NET.Test.Sdk, xunit), so tests won’t build or run. Re-add these PackageReferences or ensure they're imported via the shared props.
<ItemGroup>
src/Light.TemporaryStreams.Core/Hashing/HashingPlugin.cs:82
- This declaration shadows the earlier
Stream currentStreamand leaves it unused. Remove the initial declaration or reuse the same variable to avoid shadowing.
var currentStream = innerStream;
tests/Light.TemporaryStreams.Core.Tests/Hashing/CopyToHashCalculatorTests.cs:38
- [nitpick] The test now uses
SHA1.Create()but originally targeted SHA3-512. Verify thatSHA1is the intended algorithm for this test or revert to the original to maintain test accuracy.
await using CopyToHashCalculator calculator = SHA1.Create();
…softLogging_WhenCorrespondingArgumentIsFalse Signed-off-by: Kenny Pflug <kenny.pflug@live.de>
This pull request introduces several changes to enhance the
Light.TemporaryStreamsproject by adding support for Microsoft.Extensions.DependencyInjection and Logging, improving project structure, and refining test coverage. The most important changes include adding new extension methods for dependency injection and logging, restructuring project files, and updating test configurations.Dependency Injection and Logging Integration:
src/Light.TemporaryStreams/MicrosoftLoggingExtensions.cs: Added extension methods forILoggerto log errors related to temporary streams.src/Light.TemporaryStreams/ServiceCollectionExtensions.cs: Introduced methods to registerTemporaryStreamServiceand its dependencies intoIServiceCollection, with optional integration into Microsoft.Extensions.Logging.Project Structure Updates:
src/Directory.Build.propsandtests/Directory.Build.props: Added shared MSBuild properties for thesrcandtestsdirectories to centralize configurations. [1] [2]Light.TemporaryStreams.sln: Updated the solution file to include new projects and their configurations. [1] [2] [3]Test Enhancements:
tests/Light.TemporaryStreams.Tests/ServiceCollectionExtensionsTests.cs: Added tests to verify the registration of services, behavior of error handlers, and integration with Microsoft.Extensions.Logging.tests/Light.TemporaryStreams.Tests/Light.TemporaryStreams.Tests.csproj: Configured the test project to include necessary dependencies for testing logging and service registration.Package Updates:
Directory.Packages.props: Added Microsoft.Extensions packages and a logging library for xUnit to support new features.src/Light.TemporaryStreams/packages.lock.json: Updated the lock file to reflect new package dependencies.These changes collectively improve the project's extensibility, maintainability, and testing capabilities.