Skip to content

Conversation

@gimlichael
Copy link
Member

@gimlichael gimlichael commented Apr 13, 2025

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.Xunit package versions, and refactoring authentication-related test cases to use webApp.Host.Services and middleware.Host.Services instead of ServiceProvider.

Package Updates:

  • Updated Codebelt.Extensions.Xunit, Codebelt.Extensions.Xunit.Hosting, and Codebelt.Extensions.Xunit.Hosting.AspNetCore packages to version 10.0.0 in Directory.Packages.props.

Test Case Refactoring:

  • Refactored BasicAuthenticationHandlerTest to remove hostFixture parameter and use webApp.Host.Services for service resolution. [1] [2] [3]
  • Refactored BasicAuthenticationMiddlewareTest to remove hostFixture parameter and use middleware.Host.Services for service resolution. [1] [2] [3]
  • Refactored DigestAccessAuthenticationHandlerTest to remove hostFixture parameter and use webApp.Host.Services for service resolution. [1] [2] [3] [4] [5]
  • Refactored DigestAccessAuthenticationMiddlewareTest to remove hostFixture parameter and use middleware.Host.Services for service resolution. [1] [2] [3] [4]
  • Refactored HmacAuthenticationHandlerTest to remove hostFixture parameter and use webApp.Host.Services for service resolution. [1] [2] [3]
  • Refactored HmacAuthenticationMiddlewareTest to remove hostFixture parameter and use middleware.Host.Services for service resolution.
  • Refactored HmacAuthorizationHeaderBuilderTest to remove hostFixture parameter and use mw.Host.Services for service resolution.
  • Refactored ApplicationBuilderExtensionsTest to remove hostFixture parameter. [1] [2]

Summary by CodeRabbit

  • Chores

    • Upgraded several package dependencies to their latest versions for enhanced stability.
  • Tests

    • Streamlined test host configuration and dependency resolution across the suite.
    • Improved asynchronous test methods and updated class inheritance to boost reliability.
    • Simplified method calls to reduce unnecessary parameters for a cleaner test setup.

@gimlichael gimlichael self-assigned this Apr 13, 2025
@coderabbitai
Copy link

coderabbitai bot commented Apr 13, 2025

Walkthrough

The changes update dependency versions and streamline test infrastructure across multiple projects. In the Directory.Packages.props file the Codebelt.Extensions.Xunit packages are upgraded from 9.1.3 to 10.0.0. Numerous test files have been modified to remove redundant hostFixture: null parameters; service retrieval expressions now consistently use Host.Services instead of ServiceProvider. In addition, several test classes have been updated to use new fixture types (e.g., ManagedHostFixture) and asynchronous method signatures now return Task instead of void. The core functionality and assertions remain unchanged.

Changes

File(s) Change Summary
Directory.Packages.props Upgraded Codebelt.Extensions.Xunit, Hosting, and Hosting.AspNetCore packages from 9.1.3 to 10.0.0.
Authentication & Middleware Tests (Basic, Digest, Hmac, etc.) Removed hostFixture: null from factory method calls and updated service retrieval from ServiceProvider to Host.Services.
MVC & Razor/TagHelper Tests Removed unnecessary hostFixture: null parameters and simplified WebHostTestFactory.Create calls, accessing services via Host.Services.
Hosting & Environment Tests Updated test class inheritance (e.g., from AspNetCoreHostTest/HostTest to WebHostTest with ManagedHostFixture) and renamed HostingEnvironment to Environment.
Data & Caching Tests Adjusted dependency resolution to retrieve services from host.Host.Services and updated base class and constructor parameters.
AuthorizationResponseHandlerTest Changed asynchronous test method signatures from async void to async Task and applied await using for proper asynchronous resource disposal.
Formatters & Http Extensions Tests Removed redundant host fixture parameters, and standardized service resolution to use Host.Services.

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()
Loading

Poem

I'm a hopping rabbit, light on my feet,
Leaping over nulls—no more hostFixture to meet.
I munch on fresh services from Host.Services with delight,
Upgraded packages and async tasks shining bright.
In this coding field, every change makes me cheer—
A joyful hop toward a cleaner year! 🥕🐇

Tip

⚡💬 Agentic Chat (Pro Plan, General Availability)
  • We're introducing multi-step agentic chat in review comments and issue comments, within and outside of PR's. This feature enhances review and issue discussions with the CodeRabbit agentic chat by enabling advanced interactions, including the ability to create pull requests directly from comments and add commits to existing pull requests.
✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a 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 Consistency

The test now calls WebHostTestFactory.RunAsync without the redundant hostFixture: null parameter. The use of the pipelineSetup and hostSetup delegates 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 via app.ApplicationServices (i.e. using Host.Services), as outlined in the PR objectives.

test/Cuemon.AspNetCore.Razor.TagHelpers.Tests/AppLinkTagHelperTest.cs (2)

38-40: Streamline Test Factory Call

The removal of the redundant hostFixture: null argument from the WebHostTestFactory.Create call 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 Test

Similarly, in the cache busting test case, the hostFixture: null parameter has been removed from the WebHostTestFactory.Create call. 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

📥 Commits

Reviewing files that changed from the base of the PR and between 57bc994 and ff49360.

📒 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 v10

The class now inherits from ManagedHostFixture instead of HostFixture, 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 clarity

Renaming from HostingEnvironment to Environment makes 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 call

The removal of the hostFixture: null parameter 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 applied

Similar to the previous change, the hostFixture parameter 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 good

The 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:

  1. Removed the unnecessary hostFixture: null parameter from WebHostTestFactory.Create()
  2. Updated service resolution to use mw.Host.Services instead of the previous ServiceProvider

These 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 Behavior

The assertions verify that the header added by the HostingEnvironmentOptions middleware 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 upgrade

The changes from HostFixture to ManagedHostFixture and from hostFixture.ServiceProvider to hostFixture.Host.Services properly 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.ServiceProvider to middleware.Host.Services for 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.Services instead of the now deprecated ServiceProvider approach, maintaining consistency across all tests.


126-129: Updated service access pattern correctly implemented.

The change from accessing services via ServiceProvider to using middleware.Host.Services matches 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 ManagedHostFixture instead of HostFixture, 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.Services for retrieving dependencies instead of the previous ServiceProvider, 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 upgrade

The change from HostTest<HostFixture> to HostTest<ManagedHostFixture> aligns with the PR objectives of updating to Codebelt.Extensions.Xunit v10.0.0, which appears to use the newer ManagedHostFixture type as the preferred hosting model for tests.


30-30: Updated constructor parameter to match new base class

This change correctly updates the constructor parameter type to match the updated class inheritance.


32-32: Standardized service resolution using Host.Services

This modification aligns with the PR objective to use Host.Services for service resolution instead of the previous ServiceProvider. 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.Services instead of filter.ServiceProvider. This change aligns with the PR objectives of updating to Codebelt.Extensions.Xunit v10.0.0 and standardizing service resolution through the Host.Services property.

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 parameter

Removing the redundant hostFixture: null parameter 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 parameter

The removal of the hostFixture: null parameter 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 parameter

Removing the hostFixture: null parameter 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 parameter

The 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 parameter

The removal of the hostFixture: null parameter 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 parameter

This 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 parameter

Removing the unnecessary hostFixture: null parameter 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 parameter

This 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 API

The removal of the hostFixture: null parameter 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 API

Consistent with other changes in the file, this removes the hostFixture: null parameter from the RunAsync method call to match the updated API in Codebelt.Extensions.Xunit v10.0.0.


106-106: Clean refactoring to match updated package API

The removal of the hostFixture: null parameter from the Create method call aligns with the updated package API, maintaining consistent usage patterns across the codebase.


108-108: Improved service resolution approach

Changing from webApp.ServiceProvider to webApp.Host.Services for 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 API

Similar to other changes in this file, this removes the hostFixture: null parameter 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: null parameter 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.ServiceProvider to filter.Host.Services for 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.Environment property 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 HostFixture to ManagedHostFixture aligns 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 HostingEnvironment to Environment property 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 Environment property.


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 Environment property reference.

test/Cuemon.AspNetCore.Razor.TagHelpers.Tests/CdnLinkTagHelperTest.cs (2)

40-40: Streamlined WebHostTestFactory.Create call in Page_RenderLinkTagForCdnRole.

The removal of the hostFixture: null argument 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: null parameter 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.Services

The code has been updated to use host.Host.Services instead of the previous host.ServiceProvider for 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 pattern

The service resolution pattern has been updated from using host.ServiceProvider to host.Host.Services across 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 directives

Added imports for System.Threading.Tasks to support async/Task return types and Cuemon.Security.Cryptography for cryptographic operations in the digest authentication tests.

Also applies to: 19-19


42-42: Improved async method signatures

Test methods have been properly updated to return Task instead of void, 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 bootstrapping

The test now uses await using for 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 implementation

The test now properly retrieves authentication options using Host.Services and implements a more complete digest authentication flow using the DigestAuthorizationHeaderBuilder. This approach provides better test coverage of the authentication process.


578-653: Added new test for minimal-style ASP.NET bootstrapping

A 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 authentication

The test has been refactored to use await using for proper resource disposal and now properly retrieves services via Host.Services. The implementation now includes a complete digest authentication flow with proper header building and response verification.


987-987: Updated logger service resolution

Logger retrieval now uses Host.Services instead of ServiceProvider, 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 pattern

The change from hostFixture.ServiceProvider to hostFixture.Host.Services for 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 parameter

The removal of the hostFixture: null parameter from the WebHostTestFactory.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 call

The removal of the parameter from WebHostTestFactory.Create() is consistent with the PR objectives of removing redundant hostFixture: null parameters from test cases.


25-25: LGTM! Updated service resolution approach

The change from host.ServiceProvider to host.Host.Services for 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 pattern

The change from hostFixture.ServiceProvider to hostFixture.Host.Services for 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: null parameter from all WebHostTestFactory.Create method 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: null parameter from the WebHostTestFactory.Create method 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.ServiceProvider to hostFixture.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: null parameter) and service resolution path (now using Host.Services instead of ServiceProvider), 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: null parameter 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: null parameter 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: null parameter 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: null parameter 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.Services instead of hostFixture.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 - The hostFixture: null parameter removal is correct.

The removal of the redundant hostFixture: null parameter simplifies the code while maintaining the same functionality.


102-102: LGTM - The hostFixture: null parameter 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.Services instead of ServiceProvider for 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: null parameter simplifies the method call while maintaining functionality.


93-93: LGTM - Removed redundant parameter.

Consistent with the previous change, removing the hostFixture: null parameter streamlines the test code.


133-133: LGTM - Removed redundant parameter.

Continuing the consistent pattern of removal of the hostFixture: null parameter.


156-156: LGTM - Removed redundant parameter.

Removal of the hostFixture: null parameter is consistent with the previous changes.


158-158: LGTM - Updated service resolution method.

Changed from middleware.ServiceProvider to middleware.Host.Services for dependency resolution, aligning with the Xunit extensions upgrade.


198-198: LGTM - Removed redundant parameter.

Consistent with previous changes, removing the hostFixture: null parameter.


200-200: LGTM - Updated service resolution method.

Consistently changed service resolution to use middleware.Host.Services instead of ServiceProvider.

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 of HostTest<HostFixture>, which is consistent with the Xunit extensions v10 upgrade.


21-21: LGTM - Updated constructor parameter.

Constructor parameter now accepts ManagedHostFixture to match the updated base class.


23-23: LGTM - Updated service resolution method.

Service resolution now uses hostFixture.Host.Services instead of hostFixture.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 of AspNetCoreHostTest<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.Services instead of ServiceProvider, consistent with other changes across the codebase.

test/Cuemon.AspNetCore.Tests/Hosting/HostingEnvironmentMiddlewareTest.cs (4)

15-15: Appropriate update to base class inheritance

The change from AspNetCoreHostTest<AspNetCoreHostFixture> to WebHostTest<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 change

The constructor parameter has been correctly updated to ManagedWebHostFixture to align with the base class change, maintaining proper dependency injection.


23-23: Updated service resolution pattern

Changed from hostFixture.ServiceProvider to hostFixture.Host.Services, which aligns with the new pattern for accessing services in the updated Xunit extensions package.


36-36: Updated environment name source

Changed from HostingEnvironment.EnvironmentName to Environment.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 inheritance

The change from AspNetCoreHostTest<AspNetCoreHostFixture> to WebHostTest<ManagedWebHostFixture> aligns with the Codebelt.Extensions.Xunit v10.0.0 package update, ensuring consistent test infrastructure.


24-24: Constructor parameter update matches base class change

The constructor parameter has been correctly updated to ManagedWebHostFixture to align with the base class change, maintaining proper dependency injection.


26-26: Updated service resolution pattern

Changed from hostFixture.ServiceProvider to hostFixture.Host.Services, which follows the new service resolution pattern in the updated Xunit extensions package.


103-103: Removed redundant hostFixture parameter

The hostFixture: null parameter has been appropriately removed from the WebHostTestFactory.Create method call, simplifying the test setup without altering functionality.

test/Cuemon.Extensions.AspNetCore.Mvc.Formatters.Xml.Tests/XmlSerializationOutputFormatterTest.cs (1)

59-59: Removed redundant hostFixture parameter

The hostFixture: null parameter has been appropriately removed from the WebHostTestFactory.Create method 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 parameter

The hostFixture: null parameter has been appropriately removed from the WebHostTestFactory.Create method 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: null parameter, 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: null parameter 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: null parameter 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: null parameter 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: null parameter 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: null parameter 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: null parameter, creating a cleaner test setup.


139-139: Completing the consistent test setup improvements.

The removal of the hostFixture: null parameter 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: null parameter streamlines the test setup while maintaining the same functionality, consistent with changes across the codebase.


55-56: Improved service resolution approach.

Changing from middleware.ServiceProvider to middleware.Host.Services for retrieving dependencies provides better alignment with the testing framework architecture. This update matches the PR objectives of utilizing Host.Services for 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.Services instead of the previous ServiceProvider pattern, 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.Services for retrieving services.

Also applies to: 67-68


99-99: Service resolution approach updated correctly.

Consistent update to use middleware.Host.Services for retrieving services.

Also applies to: 101-102


131-131: Service resolution approach updated correctly.

Consistent update to use middleware.Host.Services for retrieving services.

Also applies to: 133-134


162-162: Service resolution approach updated correctly.

Consistent update to use middleware.Host.Services for retrieving services.

Also applies to: 164-165


193-193: Service resolution approach updated correctly.

Consistent update to use middleware.Host.Services for retrieving services.

Also applies to: 195-196


225-225: Service resolution approach updated correctly.

Consistent update to use middleware.Host.Services for 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.Services instead of the previous ServiceProvider pattern, 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.Services for retrieving services.

Also applies to: 73-73


104-104: Service resolution approach updated correctly.

Consistent update to use filter.Host.Services for retrieving services.

Also applies to: 106-106


138-138: Service resolution approach updated correctly.

Consistent update to use filter.Host.Services for retrieving services.

Also applies to: 140-140


170-170: Service resolution approach updated correctly.

Consistent update to use filter.Host.Services for retrieving services.

Also applies to: 172-172


197-197: Service resolution approach updated correctly.

Consistent update to use filter.Host.Services for 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.Services instead of the previous ServiceProvider pattern, 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.Services for retrieving services.

Also applies to: 106-107


181-181: Service resolution approach updated correctly.

Consistent update to use middleware.Host.Services for retrieving services.

Also applies to: 183-184


256-256: Service resolution approach updated correctly.

Consistent update to use middleware.Host.Services for retrieving services.

Also applies to: 258-259

test/Cuemon.AspNetCore.Authentication.Tests/Digest/DigestAccessAuthenticationHandlerTest.cs (5)

62-65: Well-executed service provider access update

The refactoring from ServiceProvider to Host.Services follows 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 pattern

The change maintains consistency with the updated pattern for service resolution through Host.Services instead of directly through ServiceProvider.


217-220: Appropriate service resolution update

This change correctly implements the service resolution pattern using Host.Services as recommended in the xunit extensions v10.


292-294: Properly implemented service resolution update

The updated approach for obtaining services through Host.Services maintains consistent access patterns throughout test classes.


334-336: Clean parameter simplification

The removal of the unnecessary hostFixture: null parameter streamlines the test setup without affecting functionality.

test/Cuemon.AspNetCore.Tests/Http/Headers/ApiKeySentinelMiddlewareTest.cs (7)

32-36: Clean refactoring of service access pattern

The update to use middleware.Host.Services instead of middleware.ServiceProvider follows the recommended pattern in xunit extensions v10. This ensures consistent service resolution across test classes.


58-62: Consistent implementation of updated service resolution

This change correctly implements the service resolution pattern using Host.Services as specified in the package update.


89-93: Properly updated service resolution

The change from middleware.ServiceProvider to middleware.Host.Services maintains consistency with the updated pattern for service resolution.


115-119: Well-executed service provider access update

Consistent implementation of the updated service resolution pattern as part of the xunit extensions v10 update.


143-147: Appropriate service resolution update

The change correctly implements the updated service resolution pattern using Host.Services.


174-178: Consistent update to service resolution

This refactoring maintains consistency with the updated pattern for accessing services through Host.Services.


204-208: Clean service resolution refactoring

The 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 simplification

The removal of the unnecessary hostFixture: null parameter streamlines the test setup without affecting functionality.


129-132: Properly implemented service resolution update

The change from webApp.ServiceProvider to webApp.Host.Services correctly implements the service resolution pattern update as part of the xunit extensions v10 adoption.


186-189: Appropriate simplification of test configuration

The removal of the hostFixture: null parameter 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 update

The change from middleware.ServiceProvider to middleware.Host.Services properly implements the service resolution pattern recommended in xunit extensions v10.


81-85: Consistent implementation of updated service resolution

This refactoring maintains consistency with the updated pattern for accessing services through Host.Services instead of directly through ServiceProvider.


133-137: Appropriate service resolution update

The change correctly implements the updated service resolution pattern using Host.Services as required by the xunit extensions v10 update.

test/Cuemon.AspNetCore.Authentication.Tests/Basic/BasicAuthenticationHandlerTest.cs (4)

57-57: Clean and consistent code formatting

The parameter hostFixture: null has 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 formatting

The parameter hostFixture: null has been removed from the WebHostTestFactory.Create call, consistent with similar changes in other test methods.


97-97: Improved service resolution approach

Changed from using webApp.ServiceProvider to webApp.Host.Services for retrieving services, which better aligns with ASP.NET Core's hosting model and the updated testing framework.


143-143: Clean and consistent code formatting

The parameter hostFixture: null has 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 class

Changed base class from AspNetCoreHostTest<AspNetCoreHostFixture> to WebHostTest<ManagedWebHostFixture> to leverage the updated testing infrastructure provided by Xunit extensions v10.


22-22: Updated constructor parameter to match base class change

The constructor parameter has been updated from AspNetCoreHostFixture to ManagedWebHostFixture to align with the base class change, ensuring proper dependency injection.


25-25: Improved service resolution pattern

Changed from hostFixture.ServiceProvider to hostFixture.Host.Services for 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 class

Changed base class from AspNetCoreHostTest<AspNetCoreHostFixture> to WebHostTest<ManagedWebHostFixture> to align with the updated testing framework pattern used consistently across the codebase.


24-24: Updated constructor parameter to match base class change

The constructor parameter has been updated from AspNetCoreHostFixture to ManagedWebHostFixture to align with the base class change, ensuring proper dependency injection.


27-27: Improved service resolution pattern

Changed from hostFixture.ServiceProvider to hostFixture.Host.Services for service access, maintaining consistency with other updated test files and better aligning with ASP.NET Core's hosting model.

@codecov
Copy link

codecov bot commented Apr 13, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.13%. Comparing base (57bc994) to head (ff49360).
Report is 1 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sonarqubecloud
Copy link

@gimlichael gimlichael merged commit abfebdc into main Apr 13, 2025
169 checks passed
@gimlichael gimlichael deleted the v9.0.5/xunit-v10-changes branch April 13, 2025 11:29
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