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>
Contributor
There was a problem hiding this comment.
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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.