-
Notifications
You must be signed in to change notification settings - Fork 5
✅ consequence changes af xunit extensions v10 #117
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
WalkthroughThe changes update dependency versions and streamline test infrastructure across multiple projects. In the Changes
Sequence Diagram(s)sequenceDiagram
participant T as Test Case
participant F as WebHostTestFactory
participant H as ManagedHostFixture
participant S as Host.Services
T->>F: Invoke Create() (without hostFixture)
F->>H: Instantiate ManagedHostFixture
H->>S: Initialize and provide core services
T->>S: Retrieve dependencies via GetRequiredService()
Poem
Tip ⚡💬 Agentic Chat (Pro Plan, General Availability)
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
🧹 Nitpick comments (3)
test/Cuemon.Extensions.AspNetCore.Tests/Hosting/ApplicationBuilderExtensionsTest.cs (1)
22-38: Refactored Test Setup Improves Clarity and ConsistencyThe test now calls
WebHostTestFactory.RunAsyncwithout the redundanthostFixture: nullparameter. The use of thepipelineSetupandhostSetupdelegates clearly separates the middleware pipeline configuration from the host environment setup. This not only simplifies the test configuration but also aligns it with the new approach of resolving services viaapp.ApplicationServices(i.e. usingHost.Services), as outlined in the PR objectives.test/Cuemon.AspNetCore.Razor.TagHelpers.Tests/AppLinkTagHelperTest.cs (2)
38-40: Streamline Test Factory CallThe removal of the redundant
hostFixture: nullargument from theWebHostTestFactory.Createcall simplifies the test setup and aligns with the updated package version (v10). This change reduces boilerplate without affecting functionality.
70-73: Consistent Removal in CacheBusting TestSimilarly, in the cache busting test case, the
hostFixture: nullparameter has been removed from theWebHostTestFactory.Createcall. This refactoring enhances code consistency across the test suite and simplifies the method invocation.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (57)
Directory.Packages.props(1 hunks)test/Cuemon.AspNetCore.Authentication.Tests/Basic/BasicAuthenticationHandlerTest.cs(3 hunks)test/Cuemon.AspNetCore.Authentication.Tests/Basic/BasicAuthenticationMiddlewareTest.cs(3 hunks)test/Cuemon.AspNetCore.Authentication.Tests/Digest/DigestAccessAuthenticationHandlerTest.cs(5 hunks)test/Cuemon.AspNetCore.Authentication.Tests/Digest/DigestAccessAuthenticationMiddlewareTest.cs(4 hunks)test/Cuemon.AspNetCore.Authentication.Tests/Hmac/HmacAuthenticationHandlerTest.cs(3 hunks)test/Cuemon.AspNetCore.Authentication.Tests/Hmac/HmacAuthenticationMiddlewareTest.cs(1 hunks)test/Cuemon.AspNetCore.Authentication.Tests/Hmac/HmacAuthorizationHeaderBuilderTest.cs(1 hunks)test/Cuemon.AspNetCore.FunctionalTests/Diagnostics/ApplicationBuilderExtensionsTest.cs(4 hunks)test/Cuemon.AspNetCore.Mvc.FunctionalTests/Filters/Diagnostics/FaultDescriptorFilterTest.cs(4 hunks)test/Cuemon.AspNetCore.Mvc.Tests/Filters/Cacheable/HttpCacheableFilterTest.cs(2 hunks)test/Cuemon.AspNetCore.Mvc.Tests/Filters/Diagnostics/FaultDescriptorFilterTest.cs(17 hunks)test/Cuemon.AspNetCore.Mvc.Tests/Filters/Diagnostics/ServerTimingFilterTest.cs(9 hunks)test/Cuemon.AspNetCore.Mvc.Tests/Filters/Headers/ApiKeySentinelFilterTest.cs(6 hunks)test/Cuemon.AspNetCore.Mvc.Tests/Filters/Headers/UserAgentSentinelFilterTest.cs(7 hunks)test/Cuemon.AspNetCore.Mvc.Tests/Filters/Throttling/ThrottlingSentinelAttributeTest.cs(2 hunks)test/Cuemon.AspNetCore.Mvc.Tests/Filters/Throttling/ThrottlingSentinelFilterTest.cs(3 hunks)test/Cuemon.AspNetCore.Mvc.Tests/GoneResultTest.cs(1 hunks)test/Cuemon.AspNetCore.Mvc.Tests/SeeOtherResultTest.cs(1 hunks)test/Cuemon.AspNetCore.Razor.TagHelpers.Tests/AppImageTagHelperTest.cs(2 hunks)test/Cuemon.AspNetCore.Razor.TagHelpers.Tests/AppLinkTagHelperTest.cs(2 hunks)test/Cuemon.AspNetCore.Razor.TagHelpers.Tests/AppScriptTagHelperTest.cs(2 hunks)test/Cuemon.AspNetCore.Razor.TagHelpers.Tests/CdnImageTagHelperTest.cs(2 hunks)test/Cuemon.AspNetCore.Razor.TagHelpers.Tests/CdnLinkTagHelperTest.cs(2 hunks)test/Cuemon.AspNetCore.Razor.TagHelpers.Tests/CdnScriptTagHelperTest.cs(2 hunks)test/Cuemon.AspNetCore.Razor.TagHelpers.Tests/GenericRazorTest.cs(1 hunks)test/Cuemon.AspNetCore.Tests/Diagnostics/ServerTimingMiddlewareTest.cs(4 hunks)test/Cuemon.AspNetCore.Tests/Hosting/HostingEnvironmentMiddlewareTest.cs(2 hunks)test/Cuemon.AspNetCore.Tests/Http/Headers/ApiKeySentinelMiddlewareTest.cs(7 hunks)test/Cuemon.AspNetCore.Tests/Http/Headers/CacheableMiddlewareTest.cs(5 hunks)test/Cuemon.AspNetCore.Tests/Http/Headers/CorrelationIdentifierMiddlewareTest.cs(1 hunks)test/Cuemon.AspNetCore.Tests/Http/Headers/RequestIdentifierMiddlewareTest.cs(1 hunks)test/Cuemon.AspNetCore.Tests/Http/Headers/UserAgentSentinelMiddlewareTest.cs(7 hunks)test/Cuemon.AspNetCore.Tests/Http/Throttling/ThrottlingSentinelMiddlewareTest.cs(3 hunks)test/Cuemon.Data.SqlClient.Tests/Assets/UserSecretsHostFixture.cs(2 hunks)test/Cuemon.Data.SqlClient.Tests/SqlDataManagerTest.cs(1 hunks)test/Cuemon.Data.SqlClient.Tests/SqlDatabaseDependencyTest.cs(1 hunks)test/Cuemon.Data.SqlClient.Tests/SqlInOperatorTest.cs(1 hunks)test/Cuemon.Data.SqlClient.Tests/SqlQueryBuilderTest.cs(1 hunks)test/Cuemon.Data.Tests/DataManagerTest.cs(1 hunks)test/Cuemon.Extensions.AspNetCore.Authentication.Tests/ApplicationBuilderExtensionsTest.cs(3 hunks)test/Cuemon.Extensions.AspNetCore.Authentication.Tests/AuthenticationBuilderExtensionsTest.cs(3 hunks)test/Cuemon.Extensions.AspNetCore.Authentication.Tests/AuthorizationResponseHandlerTest.cs(22 hunks)test/Cuemon.Extensions.AspNetCore.Mvc.Formatters.Text.Json.Tests/Converters/JsonConverterCollectionExtensionsTest.cs(1 hunks)test/Cuemon.Extensions.AspNetCore.Mvc.Formatters.Text.Json.Tests/JsonSerializationInputFormatterTest.cs(1 hunks)test/Cuemon.Extensions.AspNetCore.Mvc.Formatters.Text.Json.Tests/JsonSerializationOutputFormatterTest.cs(1 hunks)test/Cuemon.Extensions.AspNetCore.Mvc.Formatters.Xml.Tests/XmlSerializationInputFormatterTest.cs(1 hunks)test/Cuemon.Extensions.AspNetCore.Mvc.Formatters.Xml.Tests/XmlSerializationOutputFormatterTest.cs(1 hunks)test/Cuemon.Extensions.AspNetCore.Mvc.RazorPages.Tests/PageBaseExtensionsTest.cs(4 hunks)test/Cuemon.Extensions.AspNetCore.Mvc.Tests/HttpDependencyTest.cs(3 hunks)test/Cuemon.Extensions.AspNetCore.Mvc.Tests/Rendering/HtmlHelperExtensionsTest.cs(5 hunks)test/Cuemon.Extensions.AspNetCore.Tests/Hosting/ApplicationBuilderExtensionsTest.cs(1 hunks)test/Cuemon.Extensions.AspNetCore.Tests/Http/HttpRequestExtensionsTest.cs(3 hunks)test/Cuemon.Extensions.AspNetCore.Tests/Http/HttpResponseExtensionsTest.cs(1 hunks)test/Cuemon.Extensions.Hosting.Tests/HostEnvironmentExtensionsTest.cs(2 hunks)test/Cuemon.Extensions.Runtime.Caching.Tests/CacheEnumerableExtensionsTest.cs(1 hunks)test/Cuemon.Runtime.Caching.Tests/SlimMemoryCacheTest.cs(2 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (3)
test/Cuemon.AspNetCore.Authentication.Tests/Hmac/HmacAuthorizationHeaderBuilderTest.cs (1)
test/Cuemon.Data.Tests/Assets/SqliteDatabase.cs (1)
Create(12-117)
test/Cuemon.Extensions.Hosting.Tests/HostEnvironmentExtensionsTest.cs (1)
src/Cuemon.Extensions.Hosting/HostEnvironmentExtensions.cs (2)
IsLocalDevelopment(16-19)IsNonProduction(26-29)
test/Cuemon.Extensions.AspNetCore.Authentication.Tests/AuthorizationResponseHandlerTest.cs (7)
src/Cuemon.AspNetCore.Authentication/Digest/DigestAuthenticationHandler.cs (2)
Task(39-52)Task(60-71)src/Cuemon.AspNetCore.Authentication/Digest/DigestAuthenticationMiddleware.cs (2)
Task(47-70)DigestAuthorizationHeader(136-139)src/Cuemon.Core/Diagnostics/Failure.cs (1)
FaultSensitivityDetails(94-94)src/Cuemon.AspNetCore.Authentication/Digest/DigestAuthorizationHeader.cs (4)
DigestAuthorizationHeader(14-217)DigestAuthorizationHeader(27-31)DigestAuthorizationHeader(38-40)DigestAuthorizationHeader(55-67)src/Cuemon.AspNetCore.Authentication/Digest/DigestAuthorizationHeaderBuilder.cs (3)
ComputeHash1(202-210)ComputeHash2(218-234)ComputeResponse(242-251)test/Cuemon.AspNetCore.Mvc.Tests/Filters/Diagnostics/FaultDescriptorFilterTest.cs (1)
Theory(27-92)test/Cuemon.AspNetCore.Mvc.FunctionalTests/Filters/Diagnostics/FaultDescriptorFilterTest.cs (4)
Theory(25-283)Theory(285-554)Theory(558-803)Theory(805-1071)
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: 🪟 Prepare Windows
- GitHub Check: 🐧 Prepare Linux
🔇 Additional comments (147)
test/Cuemon.Data.SqlClient.Tests/Assets/UserSecretsHostFixture.cs (2)
10-10: Base class update aligned with Xunit extensions v10The class now inherits from
ManagedHostFixtureinstead ofHostFixture, which is consistent with the version 10.0.0 update of the Codebelt.Extensions.Xunit packages mentioned in the PR objectives. This change embraces the new API structure provided by the updated packages.
32-32: Property name change improves clarityRenaming from
HostingEnvironmenttoEnvironmentmakes the code more concise while maintaining clarity. This change is consistent with common .NET naming conventions and aligns with the broader refactoring effort in this PR.test/Cuemon.AspNetCore.Mvc.Tests/Filters/Cacheable/HttpCacheableFilterTest.cs (2)
38-38: LGTM: Simplified WebHostTestFactory.Create callThe removal of the
hostFixture: nullparameter aligns with the broader refactoring pattern across the codebase to streamline test initialization. This change matches the PR objectives of updating to Codebelt.Extensions.Xunit v10.0.0.
67-67: LGTM: Consistent refactoring appliedSimilar to the previous change, the
hostFixtureparameter has been correctly removed here as well, maintaining consistency throughout the test class.test/Cuemon.AspNetCore.Authentication.Tests/Hmac/HmacAuthorizationHeaderBuilderTest.cs (1)
23-24: Code refactoring looks goodThe changes here follow the pattern described in the PR objectives, correctly updating the test setup to use the new Codebelt.Extensions.Xunit v10 approach. Specifically:
- Removed the unnecessary
hostFixture: nullparameter fromWebHostTestFactory.Create()- Updated service resolution to use
mw.Host.Servicesinstead of the previousServiceProviderThese changes align with modern ASP.NET Core hosting patterns and create a more consistent approach across the test suite.
test/Cuemon.Extensions.AspNetCore.Tests/Hosting/ApplicationBuilderExtensionsTest.cs (1)
40-42: Assertions Confirm Correct Middleware BehaviorThe assertions verify that the header added by the
HostingEnvironmentOptionsmiddleware is present with the expected name and value, and that the suppression predicate returns false. These checks ensure that the updated middleware configuration is functioning as intended.test/Cuemon.AspNetCore.Mvc.Tests/SeeOtherResultTest.cs (1)
16-16: Changes align well with package upgradeThe changes from
HostFixturetoManagedHostFixtureand fromhostFixture.ServiceProvidertohostFixture.Host.Servicesproperly implement the updated pattern required by Codebelt.Extensions.Xunit v10.0.0. These modifications match the PR objectives while maintaining the same test functionality.Also applies to: 20-20, 22-22
test/Cuemon.AspNetCore.Tests/Http/Throttling/ThrottlingSentinelMiddlewareTest.cs (3)
38-42: Service access update aligns with Xunit extensions v10.The change from
middleware.ServiceProvidertomiddleware.Host.Servicesfor accessing services is consistent with the updated API in Codebelt.Extensions.Xunit v10.0.0. This properly utilizes the host's service container.
79-83: Service resolution correctly updated to use Host.Services.Consistent with the first test method, the service resolution has been properly updated here to use
middleware.Host.Servicesinstead of the now deprecatedServiceProviderapproach, maintaining consistency across all tests.
126-129: Updated service access pattern correctly implemented.The change from accessing services via
ServiceProviderto usingmiddleware.Host.Servicesmatches the pattern established in the other test methods and aligns with the updated Xunit extensions v10 API requirements.test/Cuemon.Extensions.Runtime.Caching.Tests/CacheEnumerableExtensionsTest.cs (3)
16-16: Successful upgrade to ManagedHostFixture base class.The base class has been updated to use
ManagedHostFixtureinstead ofHostFixture, aligning with the package version upgrade to Codebelt.Extensions.Xunit 10.0.0 as indicated in the PR objectives.
21-21: Correctly updated constructor parameter to match base class.The constructor parameter has been properly updated to match the new base class type, ensuring type consistency throughout the inheritance chain.
23-23: Standardized service resolution method.The code now properly uses
hostFixture.Host.Servicesfor retrieving dependencies instead of the previousServiceProvider, which is consistent with the PR's goal of standardizing service resolution across test cases.test/Cuemon.Runtime.Caching.Tests/SlimMemoryCacheTest.cs (3)
16-16: Updated test class inheritance following package upgradeThe change from
HostTest<HostFixture>toHostTest<ManagedHostFixture>aligns with the PR objectives of updating to Codebelt.Extensions.Xunit v10.0.0, which appears to use the newerManagedHostFixturetype as the preferred hosting model for tests.
30-30: Updated constructor parameter to match new base classThis change correctly updates the constructor parameter type to match the updated class inheritance.
32-32: Standardized service resolution using Host.ServicesThis modification aligns with the PR objective to use
Host.Servicesfor service resolution instead of the previousServiceProvider. This appears to be a standardized pattern across all refactored tests in this PR.test/Cuemon.AspNetCore.Mvc.Tests/Filters/Headers/UserAgentSentinelFilterTest.cs (1)
46-46: Service resolution pattern updated to use Host.Services.The service retrieval pattern has been consistently updated across all test methods to use
filter.Host.Servicesinstead offilter.ServiceProvider. This change aligns with the PR objectives of updating to Codebelt.Extensions.Xunit v10.0.0 and standardizing service resolution through theHost.Servicesproperty.Also applies to: 83-83, 112-112, 145-145, 182-182, 210-210, 237-237
test/Cuemon.AspNetCore.Razor.TagHelpers.Tests/AppImageTagHelperTest.cs (2)
40-40: LGTM: Simplified method call by removing redundant parameterRemoving the redundant
hostFixture: nullparameter improves code clarity. This change is consistent with the other test files and the PR's objective to streamline test case structure.
73-73: LGTM: Simplified method call by removing redundant parameterThe removal of the
hostFixture: nullparameter cleans up the method call while maintaining the same functionality, improving the readability of the test code.test/Cuemon.AspNetCore.Razor.TagHelpers.Tests/AppScriptTagHelperTest.cs (2)
40-40: LGTM: Simplified method call by removing redundant parameterRemoving the
hostFixture: nullparameter streamlines the code while maintaining functionality. This change is part of the broader effort to improve consistency across test cases.
73-73: LGTM: Simplified method call by removing redundant parameterThe removal of the redundant parameter improves code readability without affecting test functionality.
test/Cuemon.AspNetCore.Razor.TagHelpers.Tests/CdnImageTagHelperTest.cs (2)
40-40: LGTM: Simplified method call by removing redundant parameterThe removal of the
hostFixture: nullparameter streamlines the test code without altering functionality, matching the PR's objective to improve code consistency.
73-73: LGTM: Simplified method call by removing redundant parameterThis change successfully removes the redundant parameter from the method call, maintaining the same behavior while improving code clarity.
test/Cuemon.AspNetCore.Razor.TagHelpers.Tests/CdnScriptTagHelperTest.cs (2)
40-40: LGTM: Simplified method call by removing redundant parameterRemoving the unnecessary
hostFixture: nullparameter simplifies the code while maintaining test functionality. This follows the consistent pattern observed in other test files.
73-73: LGTM: Simplified method call by removing redundant parameterThis change successfully removes the redundant parameter, improving code readability and maintaining consistent style across the test suite.
test/Cuemon.AspNetCore.Tests/Diagnostics/ServerTimingMiddlewareTest.cs (5)
53-53: Clean refactoring to match updated package APIThe removal of the
hostFixture: nullparameter simplifies the method call while maintaining the same functionality. This change aligns with the updated Codebelt.Extensions.Xunit v10.0.0 package.
77-77: Clean refactoring to match updated package APIConsistent with other changes in the file, this removes the
hostFixture: nullparameter from theRunAsyncmethod call to match the updated API in Codebelt.Extensions.Xunit v10.0.0.
106-106: Clean refactoring to match updated package APIThe removal of the
hostFixture: nullparameter from theCreatemethod call aligns with the updated package API, maintaining consistent usage patterns across the codebase.
108-108: Improved service resolution approachChanging from
webApp.ServiceProvidertowebApp.Host.Servicesfor retrieving services provides better consistency with ASP.NET Core conventions and other tests in the codebase. This change is in line with the broader refactoring effort mentioned in the PR objectives.
142-142: Clean refactoring to match updated package APISimilar to other changes in this file, this removes the
hostFixture: nullparameter to align with the updated Codebelt.Extensions.Xunit v10.0.0 package. This consistent approach simplifies the testing infrastructure across the codebase.test/Cuemon.AspNetCore.Mvc.Tests/Filters/Diagnostics/ServerTimingFilterTest.cs (3)
54-54: LGTM! Clean WebHostTestFactory.Create usage.The removal of the
hostFixture: nullparameter from all WebHostTestFactory.Create calls simplifies the code and makes it more readable.Also applies to: 81-81, 105-105, 130-130, 151-151, 176-176, 210-210, 268-268
181-181: LGTM! Improved service resolution pattern.Changing from
filter.ServiceProvidertofilter.Host.Servicesfor service resolution aligns with modern ASP.NET Core conventions and the updated Xunit extensions v10 package.Also applies to: 215-215, 242-242, 244-244, 270-270
249-249: LGTM! Simplified environment access.Using the
filter.Environmentproperty directly instead of retrieving it through the service provider is a cleaner approach.Also applies to: 276-276
test/Cuemon.Extensions.Hosting.Tests/HostEnvironmentExtensionsTest.cs (7)
9-11: Appropriate fixture type upgrade to ManagedHostFixture.The change from
HostFixturetoManagedHostFixturealigns with the Codebelt.Extensions.Xunit package update to version 10.0.0 mentioned in the PR objectives. This is a proper modernization of the test infrastructure.
28-31: LGTM! Property reference updated correctly.The change from
HostingEnvironmenttoEnvironmentproperty is consistent with the updated package approach. All assertions remain functionally equivalent.
33-36: LGTM! Consistent property update in the pre-.NET 8 branch.The property reference updates are consistently applied in the conditional compilation branch for pre-.NET 8 environments.
38-38: LGTM! TestOutput reference updated.The TestOutput statement correctly uses the updated
Environmentproperty.
45-46: LGTM! IsNonProduction test updated correctly.The property reference changes are properly applied in the second test method for .NET 8+.
48-49: LGTM! Consistent updates in pre-.NET 8 branch.The property references are consistently updated in the pre-.NET 8 branch of the IsNonProduction test as well.
51-51: LGTM! TestOutput reference consistent.The final TestOutput statement correctly uses the updated
Environmentproperty reference.test/Cuemon.AspNetCore.Razor.TagHelpers.Tests/CdnLinkTagHelperTest.cs (2)
40-40: Streamlined WebHostTestFactory.Create call in Page_RenderLinkTagForCdnRole.The removal of the
hostFixture: nullargument aligns with the updated v10 API and simplifies the test setup. Please verify that calls to this method across the codebase now conform to the updated signature.
73-73: Streamlined WebHostTestFactory.Create call in Page_RenderLinkTagForCdnRole_WithCacheBusting.Removing the explicit
hostFixture: nullparameter here further cleans up the test code and ensures usage consistency. Confirm that this change works as intended with respect to service resolution and host configuration.test/Cuemon.Extensions.AspNetCore.Authentication.Tests/ApplicationBuilderExtensionsTest.cs (1)
32-32: Service resolution updated to use Host.ServicesThe code has been updated to use
host.Host.Servicesinstead of the previoushost.ServiceProviderfor service resolution. This change aligns with the package update to Codebelt.Extensions.Xunit v10.0.0 mentioned in the PR objectives.Also applies to: 34-34, 58-58, 60-60, 84-84, 86-86
test/Cuemon.Extensions.AspNetCore.Authentication.Tests/AuthenticationBuilderExtensionsTest.cs (1)
31-31: Service resolution updated to use Host.Services patternThe service resolution pattern has been updated from using
host.ServiceProvidertohost.Host.Servicesacross all test methods. This change is consistent with the PR objectives to update for Xunit extensions v10 compatibility.Also applies to: 33-34, 58-58, 60-61, 84-84, 86-87
test/Cuemon.Extensions.AspNetCore.Authentication.Tests/AuthorizationResponseHandlerTest.cs (7)
6-6: Added necessary using directivesAdded imports for
System.Threading.Tasksto support async/Task return types andCuemon.Security.Cryptographyfor cryptographic operations in the digest authentication tests.Also applies to: 19-19
42-42: Improved async method signaturesTest methods have been properly updated to return
Taskinstead ofvoid, which is a best practice for async methods. This change improves exception handling, allows proper awaiting, and ensures tests run correctly in the testing framework.Also applies to: 113-113, 190-190, 267-267, 357-357, 446-446, 503-503, 772-772, 947-947, 1010-1010
505-540: Updated Digest authentication test bootstrappingThe test now uses
await usingfor proper asynchronous resource disposal and changes the test setup to a more modern approach. This is consistent with updates needed for Xunit extensions v10 compatibility.
542-576: Enhanced Digest authentication testing implementationThe test now properly retrieves authentication options using
Host.Servicesand implements a more complete digest authentication flow using theDigestAuthorizationHeaderBuilder. This approach provides better test coverage of the authentication process.
578-653: Added new test for minimal-style ASP.NET bootstrappingA new test method has been added that tests the same digest authentication functionality but using the minimal API style for ASP.NET bootstrapping. This helps ensure the authentication works correctly with different bootstrapping approaches.
660-767: Updated JSON native response test for Digest authenticationThe test has been refactored to use
await usingfor proper resource disposal and now properly retrieves services viaHost.Services. The implementation now includes a complete digest authentication flow with proper header building and response verification.
987-987: Updated logger service resolutionLogger retrieval now uses
Host.Servicesinstead ofServiceProvider, consistent with other service resolution changes throughout the codebase.Also applies to: 1050-1050
test/Cuemon.Data.SqlClient.Tests/SqlQueryBuilderTest.cs (1)
19-19: LGTM! Updated service resolution patternThe change from
hostFixture.ServiceProvidertohostFixture.Host.Servicesfor obtaining the SqlDataManager is consistent with the PR objectives of updating service resolution methods after upgrading to Codebelt.Extensions.Xunit v10.0.0.test/Cuemon.AspNetCore.Razor.TagHelpers.Tests/GenericRazorTest.cs (1)
46-46: LGTM! Removed unnecessary parameterThe removal of the
hostFixture: nullparameter from theWebHostTestFactory.Create()method call aligns with the PR objectives of streamlining test cases following the package upgrades.test/Cuemon.AspNetCore.Mvc.Tests/GoneResultTest.cs (2)
23-23: LGTM! Simplified method callThe removal of the parameter from
WebHostTestFactory.Create()is consistent with the PR objectives of removing redundanthostFixture: nullparameters from test cases.
25-25: LGTM! Updated service resolution approachThe change from
host.ServiceProvidertohost.Host.Servicesfor obtaining the HttpContext properly implements the updated service resolution pattern as described in the PR objectives.test/Cuemon.Data.SqlClient.Tests/SqlInOperatorTest.cs (1)
19-19: LGTM! Updated service resolution patternThe change from
hostFixture.ServiceProvidertohostFixture.Host.Servicesfor obtaining the SqlDataManager matches the updated service resolution approach described in the PR objectives.test/Cuemon.Extensions.AspNetCore.Mvc.Tests/Rendering/HtmlHelperExtensionsTest.cs (1)
41-41: LGTM: Simplified method calls by removing redundant parameters.The change removes the
hostFixture: nullparameter from allWebHostTestFactory.Createmethod calls, making the test code cleaner and more maintainable while maintaining the same functionality.Also applies to: 69-69, 100-100, 133-133, 167-167
test/Cuemon.Extensions.AspNetCore.Mvc.Formatters.Xml.Tests/XmlSerializationInputFormatterTest.cs (1)
62-62: LGTM: Method call simplified appropriately.The removal of the
hostFixture: nullparameter from theWebHostTestFactory.Createmethod call is consistent with the other test refactoring changes and streamlines the code.test/Cuemon.Data.SqlClient.Tests/SqlDatabaseDependencyTest.cs (1)
25-25: LGTM: Updated service resolution pattern.The change updates the way services are resolved, moving from
hostFixture.ServiceProvidertohostFixture.Host.Services, which aligns with the updated package architecture and provides a more consistent approach to service resolution across the test suite.test/Cuemon.Extensions.AspNetCore.Mvc.Formatters.Text.Json.Tests/Converters/JsonConverterCollectionExtensionsTest.cs (1)
40-40: LGTM: Modernized WebHostTestFactory usage and service resolution.The changes properly update both the test factory instantiation (removing the unnecessary
hostFixture: nullparameter) and service resolution path (now usingHost.Servicesinstead ofServiceProvider), bringing this test in line with the updated package patterns.Also applies to: 42-42
test/Cuemon.Extensions.AspNetCore.Mvc.Tests/HttpDependencyTest.cs (1)
41-41: Parameter removal from WebHostTestFactory.Create calls looks good.This change aligns with the PR objectives to refactor test cases by removing the unnecessary
hostFixture: nullparameter from WebHostTestFactory.Create calls, making the code cleaner while maintaining the same functionality.Also applies to: 97-97, 154-154
test/Cuemon.AspNetCore.Mvc.Tests/Filters/Diagnostics/FaultDescriptorFilterTest.cs (1)
44-44: Consistently removed hostFixture parameter across all test cases.The changes consistently remove the
hostFixture: nullparameter across all WebHostTestFactory.CreateWithHostBuilderContext calls in the file. This simplifies the test setup code while maintaining the same functionality, which is in line with the broader test refactoring effort.Also applies to: 112-112, 155-155, 188-188, 221-221, 254-254, 287-287, 320-320, 353-353, 386-386, 419-419, 452-452, 484-484, 518-518, 551-551, 584-584, 614-614
test/Cuemon.AspNetCore.Mvc.FunctionalTests/Filters/Diagnostics/FaultDescriptorFilterTest.cs (1)
54-54: Streamlined WebHostTestFactory.RunAsync calls by removing hostFixture parameter.The removal of the
hostFixture: nullparameter from WebHostTestFactory.RunAsync calls makes the code more concise while maintaining functional equivalence. This change aligns with the pattern seen in other test files and supports the PR objectives of simplifying test setup.Also applies to: 314-314, 587-587, 834-834
test/Cuemon.AspNetCore.FunctionalTests/Diagnostics/ApplicationBuilderExtensionsTest.cs (1)
69-69: Successfully removed hostFixture parameter from RunAsync calls.Similar to other test files, the removal of the unnecessary
hostFixture: nullparameter from WebHostTestFactory.RunAsync calls simplifies the code while maintaining the same behavior. This change is consistent with the broader testing framework updates.Also applies to: 345-345, 603-603, 693-693
test/Cuemon.Data.SqlClient.Tests/SqlDataManagerTest.cs (1)
23-23: Updated service resolution pattern to use Host.Services.The change modifies how the SqlDataManager service is resolved, now using
hostFixture.Host.Servicesinstead ofhostFixture.ServiceProvider. This aligns with the PR objective of standardizing service resolution across tests to use Host.Services, which is consistent with the updated Xunit extensions package.test/Cuemon.AspNetCore.Mvc.Tests/Filters/Throttling/ThrottlingSentinelFilterTest.cs (3)
51-51: LGTM - ThehostFixture: nullparameter removal is correct.The removal of the redundant
hostFixture: nullparameter simplifies the code while maintaining the same functionality.
102-102: LGTM - ThehostFixture: nullparameter removal is correct.Consistent with the previous change, the removal of the redundant parameter streamlines the test setup.
119-119: LGTM - Updated service resolution method.The code now uses
filter.Host.Servicesinstead ofServiceProviderfor dependency resolution, which aligns with the Codebelt.Extensions.Xunit v10.0.0 upgrade.test/Cuemon.AspNetCore.Tests/Http/Headers/CacheableMiddlewareTest.cs (7)
57-57: LGTM - Removed redundant parameter.The removal of the
hostFixture: nullparameter simplifies the method call while maintaining functionality.
93-93: LGTM - Removed redundant parameter.Consistent with the previous change, removing the
hostFixture: nullparameter streamlines the test code.
133-133: LGTM - Removed redundant parameter.Continuing the consistent pattern of removal of the
hostFixture: nullparameter.
156-156: LGTM - Removed redundant parameter.Removal of the
hostFixture: nullparameter is consistent with the previous changes.
158-158: LGTM - Updated service resolution method.Changed from
middleware.ServiceProvidertomiddleware.Host.Servicesfor dependency resolution, aligning with the Xunit extensions upgrade.
198-198: LGTM - Removed redundant parameter.Consistent with previous changes, removing the
hostFixture: nullparameter.
200-200: LGTM - Updated service resolution method.Consistently changed service resolution to use
middleware.Host.Servicesinstead ofServiceProvider.test/Cuemon.Data.Tests/DataManagerTest.cs (3)
17-17: LGTM - Updated base class and fixture type.The test class now inherits from
HostTest<ManagedHostFixture>instead ofHostTest<HostFixture>, which is consistent with the Xunit extensions v10 upgrade.
21-21: LGTM - Updated constructor parameter.Constructor parameter now accepts
ManagedHostFixtureto match the updated base class.
23-23: LGTM - Updated service resolution method.Service resolution now uses
hostFixture.Host.Servicesinstead ofhostFixture.ServiceProvider, aligning with the updated Xunit extensions.test/Cuemon.AspNetCore.Tests/Http/Headers/CorrelationIdentifierMiddlewareTest.cs (3)
16-16: LGTM - Updated base class and fixture type.The test class now inherits from
WebHostTest<ManagedWebHostFixture>instead ofAspNetCoreHostTest<AspNetCoreHostFixture>, which is part of the Xunit extensions v10 upgrade.
21-21: LGTM - Updated constructor parameter.Constructor parameter updated to match the new base class fixture type.
24-24: LGTM - Updated service resolution method.Service resolution now uses
hostFixture.Host.Servicesinstead ofServiceProvider, consistent with other changes across the codebase.test/Cuemon.AspNetCore.Tests/Hosting/HostingEnvironmentMiddlewareTest.cs (4)
15-15: Appropriate update to base class inheritanceThe change from
AspNetCoreHostTest<AspNetCoreHostFixture>toWebHostTest<ManagedWebHostFixture>aligns with the Codebelt.Extensions.Xunit v10.0.0 update, which introduces more consistent host management patterns across tests.
20-20: Constructor parameter update matches base class changeThe constructor parameter has been correctly updated to
ManagedWebHostFixtureto align with the base class change, maintaining proper dependency injection.
23-23: Updated service resolution patternChanged from
hostFixture.ServiceProvidertohostFixture.Host.Services, which aligns with the new pattern for accessing services in the updated Xunit extensions package.
36-36: Updated environment name sourceChanged from
HostingEnvironment.EnvironmentNametoEnvironment.EnvironmentName, which is consistent with the updated hosting model in the new package version.test/Cuemon.AspNetCore.Mvc.Tests/Filters/Throttling/ThrottlingSentinelAttributeTest.cs (4)
20-20: Appropriate update to base class inheritanceThe change from
AspNetCoreHostTest<AspNetCoreHostFixture>toWebHostTest<ManagedWebHostFixture>aligns with the Codebelt.Extensions.Xunit v10.0.0 package update, ensuring consistent test infrastructure.
24-24: Constructor parameter update matches base class changeThe constructor parameter has been correctly updated to
ManagedWebHostFixtureto align with the base class change, maintaining proper dependency injection.
26-26: Updated service resolution patternChanged from
hostFixture.ServiceProvidertohostFixture.Host.Services, which follows the new service resolution pattern in the updated Xunit extensions package.
103-103: Removed redundant hostFixture parameterThe
hostFixture: nullparameter has been appropriately removed from theWebHostTestFactory.Createmethod call, simplifying the test setup without altering functionality.test/Cuemon.Extensions.AspNetCore.Mvc.Formatters.Xml.Tests/XmlSerializationOutputFormatterTest.cs (1)
59-59: Removed redundant hostFixture parameterThe
hostFixture: nullparameter has been appropriately removed from theWebHostTestFactory.Createmethod call, simplifying the test setup without changing functionality.test/Cuemon.Extensions.AspNetCore.Mvc.Formatters.Text.Json.Tests/JsonSerializationOutputFormatterTest.cs (1)
59-59: Removed redundant hostFixture parameterThe
hostFixture: nullparameter has been appropriately removed from theWebHostTestFactory.Createmethod call, simplifying the test setup without changing functionality.test/Cuemon.Extensions.AspNetCore.Mvc.Formatters.Text.Json.Tests/JsonSerializationInputFormatterTest.cs (1)
62-62: Clean refactor removing the unnecessary hostFixture parameter.This change simplifies the method call by removing the explicit
hostFixture: nullparameter, which aligns with the PR objectives of streamlining test setups across the codebase.test/Cuemon.Extensions.AspNetCore.Tests/Http/HttpRequestExtensionsTest.cs (3)
40-40: Clean refactoring of test setup.Removing the redundant
hostFixture: nullparameter simplifies the test setup while maintaining the same functionality. This is consistent with the PR objectives of streamlining test infrastructure.
65-65: Consistent test setup simplification.Removal of the unneeded
hostFixture: nullparameter maintains consistency with other test methods in this file and across the codebase.
119-119: Maintaining consistency in test setup.The removal of the redundant
hostFixture: nullparameter here completes the consistent simplification across all test methods in this file.test/Cuemon.Extensions.AspNetCore.Mvc.RazorPages.Tests/PageBaseExtensionsTest.cs (4)
41-41: Clean test setup simplification.Removing the redundant
hostFixture: nullparameter streamlines the test setup while maintaining the same functionality, aligning with the overall PR goal of simplifying test infrastructure.
74-74: Consistent test setup improvement.The removal of the unnecessary
hostFixture: nullparameter maintains consistency with other test methods in this file and across the codebase.
106-106: Maintaining consistency in test setup refactoring.This change follows the same pattern of removing the redundant
hostFixture: nullparameter, creating a cleaner test setup.
139-139: Completing the consistent test setup improvements.The removal of the
hostFixture: nullparameter here completes the consistent simplification across all test methods in this file, resulting in cleaner and more maintainable code.test/Cuemon.AspNetCore.Authentication.Tests/Hmac/HmacAuthenticationMiddlewareTest.cs (2)
53-53: Clean test setup simplification.Removing the redundant
hostFixture: nullparameter streamlines the test setup while maintaining the same functionality, consistent with changes across the codebase.
55-56: Improved service resolution approach.Changing from
middleware.ServiceProvidertomiddleware.Host.Servicesfor retrieving dependencies provides better alignment with the testing framework architecture. This update matches the PR objectives of utilizingHost.Servicesfor service resolution.Directory.Packages.props (1)
8-10: Verified package version updates align with PR objectives.The updates to the Codebelt.Extensions.Xunit packages from 9.1.3 to 10.0.0 match the intended changes mentioned in the PR description.
test/Cuemon.AspNetCore.Tests/Http/Headers/UserAgentSentinelMiddlewareTest.cs (7)
35-35: Service resolution approach updated correctly.The code has been refactored to use
middleware.Host.Servicesinstead of the previousServiceProviderpattern, which aligns with the updated xUnit extensions package.Also applies to: 37-38
65-65: Service resolution approach updated correctly.Consistent update to use
middleware.Host.Servicesfor retrieving services.Also applies to: 67-68
99-99: Service resolution approach updated correctly.Consistent update to use
middleware.Host.Servicesfor retrieving services.Also applies to: 101-102
131-131: Service resolution approach updated correctly.Consistent update to use
middleware.Host.Servicesfor retrieving services.Also applies to: 133-134
162-162: Service resolution approach updated correctly.Consistent update to use
middleware.Host.Servicesfor retrieving services.Also applies to: 164-165
193-193: Service resolution approach updated correctly.Consistent update to use
middleware.Host.Servicesfor retrieving services.Also applies to: 195-196
225-225: Service resolution approach updated correctly.Consistent update to use
middleware.Host.Servicesfor retrieving services.Also applies to: 227-228
test/Cuemon.AspNetCore.Mvc.Tests/Filters/Headers/ApiKeySentinelFilterTest.cs (6)
41-41: Service resolution approach updated correctly.The code has been refactored to use
filter.Host.Servicesinstead of the previousServiceProviderpattern, following the same pattern as other test classes.Also applies to: 43-43
71-71: Service resolution approach updated correctly.Consistent update to use
filter.Host.Servicesfor retrieving services.Also applies to: 73-73
104-104: Service resolution approach updated correctly.Consistent update to use
filter.Host.Servicesfor retrieving services.Also applies to: 106-106
138-138: Service resolution approach updated correctly.Consistent update to use
filter.Host.Servicesfor retrieving services.Also applies to: 140-140
170-170: Service resolution approach updated correctly.Consistent update to use
filter.Host.Servicesfor retrieving services.Also applies to: 172-172
197-197: Service resolution approach updated correctly.Consistent update to use
filter.Host.Servicesfor retrieving services.Also applies to: 199-199
test/Cuemon.AspNetCore.Authentication.Tests/Digest/DigestAccessAuthenticationMiddlewareTest.cs (4)
55-55: Service resolution approach updated correctly.The code has been refactored to use
middleware.Host.Servicesinstead of the previousServiceProviderpattern, maintaining consistency with other authentication test classes.Also applies to: 57-58
104-104: Service resolution approach updated correctly.Consistent update to use
middleware.Host.Servicesfor retrieving services.Also applies to: 106-107
181-181: Service resolution approach updated correctly.Consistent update to use
middleware.Host.Servicesfor retrieving services.Also applies to: 183-184
256-256: Service resolution approach updated correctly.Consistent update to use
middleware.Host.Servicesfor retrieving services.Also applies to: 258-259
test/Cuemon.AspNetCore.Authentication.Tests/Digest/DigestAccessAuthenticationHandlerTest.cs (5)
62-65: Well-executed service provider access updateThe refactoring from
ServiceProvidertoHost.Servicesfollows the xunit extensions v10 pattern. This change properly aligns with the dependency resolution approach used in the updated package.
138-141: Consistent update to service resolution patternThe change maintains consistency with the updated pattern for service resolution through
Host.Servicesinstead of directly throughServiceProvider.
217-220: Appropriate service resolution updateThis change correctly implements the service resolution pattern using
Host.Servicesas recommended in the xunit extensions v10.
292-294: Properly implemented service resolution updateThe updated approach for obtaining services through
Host.Servicesmaintains consistent access patterns throughout test classes.
334-336: Clean parameter simplificationThe removal of the unnecessary
hostFixture: nullparameter streamlines the test setup without affecting functionality.test/Cuemon.AspNetCore.Tests/Http/Headers/ApiKeySentinelMiddlewareTest.cs (7)
32-36: Clean refactoring of service access patternThe update to use
middleware.Host.Servicesinstead ofmiddleware.ServiceProviderfollows the recommended pattern in xunit extensions v10. This ensures consistent service resolution across test classes.
58-62: Consistent implementation of updated service resolutionThis change correctly implements the service resolution pattern using
Host.Servicesas specified in the package update.
89-93: Properly updated service resolutionThe change from
middleware.ServiceProvidertomiddleware.Host.Servicesmaintains consistency with the updated pattern for service resolution.
115-119: Well-executed service provider access updateConsistent implementation of the updated service resolution pattern as part of the xunit extensions v10 update.
143-147: Appropriate service resolution updateThe change correctly implements the updated service resolution pattern using
Host.Services.
174-178: Consistent update to service resolutionThis refactoring maintains consistency with the updated pattern for accessing services through
Host.Services.
204-208: Clean service resolution refactoringThe update aligns with the recommended pattern in xunit extensions v10 for service resolution.
test/Cuemon.AspNetCore.Authentication.Tests/Hmac/HmacAuthenticationHandlerTest.cs (3)
63-66: Clean parameter simplificationThe removal of the unnecessary
hostFixture: nullparameter streamlines the test setup without affecting functionality.
129-132: Properly implemented service resolution updateThe change from
webApp.ServiceProvidertowebApp.Host.Servicescorrectly implements the service resolution pattern update as part of the xunit extensions v10 adoption.
186-189: Appropriate simplification of test configurationThe removal of the
hostFixture: nullparameter reduces unnecessary code without changing functionality, aligning with the updated package's conventions.test/Cuemon.AspNetCore.Authentication.Tests/Basic/BasicAuthenticationMiddlewareTest.cs (3)
39-43: Well-executed service provider access updateThe change from
middleware.ServiceProvidertomiddleware.Host.Servicesproperly implements the service resolution pattern recommended in xunit extensions v10.
81-85: Consistent implementation of updated service resolutionThis refactoring maintains consistency with the updated pattern for accessing services through
Host.Servicesinstead of directly throughServiceProvider.
133-137: Appropriate service resolution updateThe change correctly implements the updated service resolution pattern using
Host.Servicesas required by the xunit extensions v10 update.test/Cuemon.AspNetCore.Authentication.Tests/Basic/BasicAuthenticationHandlerTest.cs (4)
57-57: Clean and consistent code formattingThe parameter
hostFixture: nullhas been removed from the WebHostTestFactory.Create call, which aligns with the updated Xunit extensions v10 pattern for test setup.
95-95: Clean and consistent code formattingThe parameter
hostFixture: nullhas been removed from the WebHostTestFactory.Create call, consistent with similar changes in other test methods.
97-97: Improved service resolution approachChanged from using
webApp.ServiceProvidertowebApp.Host.Servicesfor retrieving services, which better aligns with ASP.NET Core's hosting model and the updated testing framework.
143-143: Clean and consistent code formattingThe parameter
hostFixture: nullhas been removed from the WebHostTestFactory.Create call, maintaining consistency across all test methods.test/Cuemon.AspNetCore.Tests/Http/Headers/RequestIdentifierMiddlewareTest.cs (3)
17-17: Updated test framework base classChanged base class from
AspNetCoreHostTest<AspNetCoreHostFixture>toWebHostTest<ManagedWebHostFixture>to leverage the updated testing infrastructure provided by Xunit extensions v10.
22-22: Updated constructor parameter to match base class changeThe constructor parameter has been updated from
AspNetCoreHostFixturetoManagedWebHostFixtureto align with the base class change, ensuring proper dependency injection.
25-25: Improved service resolution patternChanged from
hostFixture.ServiceProvidertohostFixture.Host.Servicesfor service access, which better aligns with ASP.NET Core's hosting model and provides a more consistent approach across tests.test/Cuemon.Extensions.AspNetCore.Tests/Http/HttpResponseExtensionsTest.cs (3)
19-19: Updated test framework base classChanged base class from
AspNetCoreHostTest<AspNetCoreHostFixture>toWebHostTest<ManagedWebHostFixture>to align with the updated testing framework pattern used consistently across the codebase.
24-24: Updated constructor parameter to match base class changeThe constructor parameter has been updated from
AspNetCoreHostFixturetoManagedWebHostFixtureto align with the base class change, ensuring proper dependency injection.
27-27: Improved service resolution patternChanged from
hostFixture.ServiceProvidertohostFixture.Host.Servicesfor service access, maintaining consistency with other updated test files and better aligning with ASP.NET Core's hosting model.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #117 +/- ##
=======================================
Coverage 80.13% 80.13%
=======================================
Files 593 593
Lines 18328 18328
Branches 1884 1884
=======================================
Hits 14687 14687
Misses 3573 3573
Partials 68 68 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|



This pull request includes updates to package versions and refactors several test cases to improve code consistency and maintainability. The most important changes include updating the
Codebelt.Extensions.Xunitpackage versions, and refactoring authentication-related test cases to usewebApp.Host.Servicesandmiddleware.Host.Servicesinstead ofServiceProvider.Package Updates:
Codebelt.Extensions.Xunit,Codebelt.Extensions.Xunit.Hosting, andCodebelt.Extensions.Xunit.Hosting.AspNetCorepackages to version 10.0.0 inDirectory.Packages.props.Test Case Refactoring:
BasicAuthenticationHandlerTestto removehostFixtureparameter and usewebApp.Host.Servicesfor service resolution. [1] [2] [3]BasicAuthenticationMiddlewareTestto removehostFixtureparameter and usemiddleware.Host.Servicesfor service resolution. [1] [2] [3]DigestAccessAuthenticationHandlerTestto removehostFixtureparameter and usewebApp.Host.Servicesfor service resolution. [1] [2] [3] [4] [5]DigestAccessAuthenticationMiddlewareTestto removehostFixtureparameter and usemiddleware.Host.Servicesfor service resolution. [1] [2] [3] [4]HmacAuthenticationHandlerTestto removehostFixtureparameter and usewebApp.Host.Servicesfor service resolution. [1] [2] [3]HmacAuthenticationMiddlewareTestto removehostFixtureparameter and usemiddleware.Host.Servicesfor service resolution.HmacAuthorizationHeaderBuilderTestto removehostFixtureparameter and usemw.Host.Servicesfor service resolution.ApplicationBuilderExtensionsTestto removehostFixtureparameter. [1] [2]Summary by CodeRabbit
Chores
Tests