Skip to content

Conversation

@gimlichael
Copy link
Member

@gimlichael gimlichael commented Sep 15, 2024

PR Classification

New feature and project restructuring.

PR Summary

This pull request introduces significant updates and rebranding of the project, focusing on enhancing unit testing capabilities for xUnit and ASP.NET Core applications.

  • Migrated Cuemon.Extensions.Xunit, Cuemon.Extensions.Xunit.App, Cuemon.Extensions.Xunit.Hosting and Cuemon.Extensions.Xunit.Hosting.AspNetCore to the confines of this repo, xunit,
  • Rebranded as Codebelt.Extensions.Xunit, Codebelt.Extensions.Xunit.App, Codebelt.Extensions.Xunit.Hosting and Codebelt.Extensions.Xunit.Hosting.AspNetCore,
  • New NuGet packages available on NuGet with codebelt as owner,
  • Latest version will be 8.4.0; a bump from previous 8.3.2,
  • Continuation of this project will continue here.

The decision to move xUnit extensions out of Cuemon for .NET is to be more true to original vision and to provide faster updates with a tighter focus.

Summary by CodeRabbit

Release Notes

  • New Features

    • Introduced WebHostTest and GenericHostTest classes to enhance unit testing capabilities for ASP.NET Core applications.
    • Added ServiceCollectionExtensions for improved logging and output management in unit tests.
    • Implemented BoolMiddleware for dynamic display of configuration values in HTTP responses, aiding debugging.
  • Bug Fixes

    • Streamlined CI/CD pipeline for enhanced build and test efficiency, focusing on pull requests and cross-platform capabilities.
  • Documentation

    • Updated documentation for new features and classes to assist developers in utilizing the extensions effectively.
  • Chores

    • Revised CI/CD pipeline configuration for improved stability and flexibility across multiple frameworks.

@coderabbitai
Copy link

coderabbitai bot commented Sep 15, 2024

Walkthrough

The changes involve extensive updates to the CI/CD pipeline configuration and the introduction of new classes and extension methods for unit testing within the Codebelt.Extensions.Xunit library. Key modifications include renaming the pipeline, altering triggers, implementing matrix strategies for builds and tests, and updating action versions for improved stability. New test classes and middleware have also been added to enhance testing capabilities for ASP.NET Core applications, promoting a structured approach to service configuration and logging.

Changes

File(s) Change Summary
.github/workflows/pipelines.yml Revised CI/CD pipeline configuration, including renaming, changing triggers from push to pull_request, adding matrix strategies, and updating action versions for stability.
src/Codebelt.Extensions.Xunit.Hosting.AspNetCore/WebHostTest.cs Introduced WebHostTest class for flexible ASP.NET Core application testing, allowing for dynamic configuration of services and application pipelines.
src/Codebelt.Extensions.Xunit.Hosting/GenericHostTest.cs Added GenericHostTest class for testing generic hosts with flexible service configuration through multiple constructors.
src/Codebelt.Extensions.Xunit.Hosting/ServiceCollectionExtensions.cs Introduced extension methods for IServiceCollection to enhance unit testing capabilities with logging and output management.
test/Codebelt.Extensions.Xunit.Hosting.AspNetCore.Tests/Assets/BoolMiddleware.cs Added BoolMiddleware class to display configuration values in HTTP responses, aiding debugging and configuration validation.

Poem

🐰 In the meadow where code takes flight,
A rabbit hops, with joy and delight.
New tests and pipelines, all shiny and bright,
With middleware magic, our futures look right!
Extensions and logging, a splendid new day,
Hopping along, we code and we play! 🌼


Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between b65375d and 0407fb9.

Files selected for processing (5)
  • .github/workflows/pipelines.yml (3 hunks)
  • src/Codebelt.Extensions.Xunit.Hosting.AspNetCore/WebHostTest.cs (1 hunks)
  • src/Codebelt.Extensions.Xunit.Hosting/GenericHostTest.cs (1 hunks)
  • src/Codebelt.Extensions.Xunit.Hosting/ServiceCollectionExtensions.cs (1 hunks)
  • test/Codebelt.Extensions.Xunit.Hosting.AspNetCore.Tests/Assets/BoolMiddleware.cs (1 hunks)
Files skipped from review as they are similar to previous changes (4)
  • src/Codebelt.Extensions.Xunit.Hosting.AspNetCore/WebHostTest.cs
  • src/Codebelt.Extensions.Xunit.Hosting/GenericHostTest.cs
  • src/Codebelt.Extensions.Xunit.Hosting/ServiceCollectionExtensions.cs
  • test/Codebelt.Extensions.Xunit.Hosting.AspNetCore.Tests/Assets/BoolMiddleware.cs
Additional context used
actionlint
.github/workflows/pipelines.yml

56-56: shellcheck reported issue in this script: SC2086:info:6:56: Double quote to prevent globbing and word splitting

(shellcheck)


56-56: shellcheck reported issue in this script: SC2086:info:8:38: Double quote to prevent globbing and word splitting

(shellcheck)

Additional comments not posted (13)
.github/workflows/pipelines.yml (13)

1-1: LGTM!

The pipeline name change accurately reflects the new focus on xUnit, aligning with the PR objectives.


3-5: LGTM!

Changing the trigger from push to pull_request is a good practice for CI/CD pipelines. It ensures that the pipeline runs before changes are merged into the main branch, catching potential issues early.


25-25: LGTM!

Adding a timeout-minutes parameter to the build job is a good practice to prevent long-running or stuck jobs from consuming resources indefinitely. The 15-minute timeout seems reasonable, but please monitor the build times and adjust the timeout if needed based on the project's specific requirements and historical data.


26-29: LGTM!

Adding a matrix strategy to the build job is a great way to improve flexibility and efficiency by allowing concurrent builds across different configurations and frameworks. The selected configurations (Debug and Release) and frameworks (.NET 8.0, .NET 6.0, .NET Standard 2.0) seem appropriate for a xUnit project targeting multiple .NET versions.


34-34: LGTM!

Changing the uses parameter for the checkout step from codebeltnet/git-checkout@main to codebeltnet/git-checkout@v1 is a good practice. Using a specific version instead of the main branch ensures greater stability and reproducibility of the pipeline.


37-39: LGTM!

Changing the uses parameter for the .NET installation step from codebeltnet/install-dotnet@main to codebeltnet/install-dotnet@v1 is a good practice. Using a specific version ensures greater stability and reproducibility of the pipeline.

Adding the includePreview parameter set to true is also beneficial, as it allows the pipeline to use preview versions of .NET for testing new features or compatibility.


42-42: LGTM!

Changing the uses parameter for the MinVer installation step from codebeltnet/dotnet-tool-install-minver@main to codebeltnet/dotnet-tool-install-minver@v1 is a good practice. Using a specific version ensures greater stability and reproducibility of the pipeline.


46-46: LGTM!

Changing the uses parameter for the version calculation step from codebeltnet/minver-calculate@main to codebeltnet/minver-calculate@v2 is a good practice. Using a specific version ensures greater stability and reproducibility of the pipeline.


48-53: LGTM!

Updating the signing key download step to use xunit.snk instead of classlibrary1.snk aligns with the migration from ClassLibrary1 to xUnit, as mentioned in the PR objectives.


55-65: LGTM!

Setting the PROJECTS variable dynamically based on the framework is a good approach to have more granular control over which projects are built and tested. The specific list of project files for netstandard2.0 suggests that only a subset of the projects is compatible with that framework, while the glob pattern used for other frameworks (src/**/*.csproj) should cover all relevant projects.

Please monitor the builds to ensure that the correct projects are included for each framework and adjust the lists or patterns if needed.

Tools
actionlint

56-56: shellcheck reported issue in this script: SC2086:info:6:56: Double quote to prevent globbing and word splitting

(shellcheck)


56-56: shellcheck reported issue in this script: SC2086:info:8:38: Double quote to prevent globbing and word splitting

(shellcheck)


69-69: LGTM!

Changing the uses parameter for the dependency restoration step from codebeltnet/dotnet-restore@main to codebeltnet/dotnet-restore@v2 is a good practice. Using a specific version ensures greater stability and reproducibility of the pipeline.


71-76: LGTM!

Changing the uses parameter for the build step from codebeltnet/dotnet-build@main to codebeltnet/dotnet-build@v2 is a good practice. Using a specific version ensures greater stability and reproducibility of the pipeline.

Using the PROJECTS variable and matrix variables (configuration and framework) allows for more dynamic and targeted builds based on the framework and configuration, which is a great improvement.


81-81: LGTM!

Adding a timeout-minutes parameter to the pack job is a good practice to prevent long-running or stuck jobs from consuming resources indefinitely. The 15-minute timeout seems reasonable, but please monitor the pack times and adjust the timeout if needed based on the project's specific requirements and historical data.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
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 generate interesting stats about this repository and render them as a table.
    -- @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 resolve resolve all the CodeRabbit review comments.
  • @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.

@codecov
Copy link

codecov bot commented Sep 15, 2024

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

@sonarqubecloud
Copy link

@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

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

Outside diff range and nitpick comments (17)
src/Codebelt.Extensions.Xunit.Hosting.AspNetCore/Http/Features/FakeHttpRequestFeature.cs (1)

15-21: Consider adding optional constructor parameters for customization.

While the default values set in the constructor (Method, Path, Scheme, Protocol) are reasonable for a generic HTTP request, providing the ability to customize these values could enhance the flexibility and reusability of this class.

Consider adding optional constructor parameters for each of these properties, allowing developers to create instances of FakeHttpRequestFeature with specific request characteristics when needed:

public FakeHttpRequestFeature(
    string method = "GET", 
    string path = "/",
    string scheme = "http",
    string protocol = "HTTP/1.1")
{
    Method = method;
    Path = path;
    Scheme = scheme;
    Protocol = protocol;
}
src/Codebelt.Extensions.Xunit.Hosting/XunitTestLoggerProvider.cs (1)

18-21: Add test coverage for the constructor accepting ITestOutputHelperAccessor.

The static analysis tool indicates that the constructor at lines 18-21 is not covered by tests. To ensure the robustness of the code, it's important to add tests for this constructor.

Do you want me to generate the test code or open a GitHub issue to track this task?

Tools
GitHub Check: codecov/patch

[warning] 18-21: src/Codebelt.Extensions.Xunit.Hosting/XunitTestLoggerProvider.cs#L18-L21
Added lines #L18 - L21 were not covered by tests

src/Codebelt.Extensions.Xunit.Hosting/ServiceProviderExtensions.cs (1)

19-22: Add test coverage for the GetRequiredScopedService method.

The static analysis tool has reported that the GetRequiredScopedService method is not covered by tests. To ensure the reliability and maintainability of this extension method, it is important to add appropriate test cases.

Please consider adding tests to cover the following scenarios:

  1. Successfully retrieving a scoped service of the specified type.
  2. Handling the case when the requested service is not available (i.e., verifying that an InvalidOperationException is thrown).

Do you want me to generate the test cases or open a GitHub issue to track this task?

Tools
GitHub Check: codecov/patch

[warning] 19-22: src/Codebelt.Extensions.Xunit.Hosting/ServiceProviderExtensions.cs#L19-L22
Added lines #L19 - L22 were not covered by tests

src/Codebelt.Extensions.Xunit.Hosting/GenericHostTestFactory.cs (2)

18-21: Reminder: Add tests for the Create method.

The static analysis tool indicates that lines 19-21 are not covered by tests. Please ensure that the method is thoroughly tested to confirm that it behaves as expected.

Do you want me to generate the unit testing code or open a GitHub issue to track this task?

Tools
GitHub Check: codecov/patch

[warning] 19-21: src/Codebelt.Extensions.Xunit.Hosting/GenericHostTestFactory.cs#L19-L21
Added lines #L19 - L21 were not covered by tests


29-32: Reminder: Add tests for the CreateWithHostBuilderContext method.

The static analysis tool indicates that lines 30-32 are not covered by tests. Please ensure that the method is thoroughly tested to confirm that it behaves as expected.

Do you want me to generate the unit testing code or open a GitHub issue to track this task?

Tools
GitHub Check: codecov/patch

[warning] 30-32: src/Codebelt.Extensions.Xunit.Hosting/GenericHostTestFactory.cs#L30-L32
Added lines #L30 - L32 were not covered by tests

src/Codebelt.Extensions.Xunit.Hosting/XunitTestLoggerEntry.cs (1)

27-27: Consider adding unit tests to cover the auto-implemented properties.

The static analysis hints indicate that the Id and Severity properties are not covered by tests. While this may not have a significant impact on the functionality, it's a good practice to ensure all code paths are tested.

Do you want me to generate the unit testing code or open a GitHub issue to track this task?

Also applies to: 33-33

Tools
GitHub Check: codecov/patch

[warning] 27-27: src/Codebelt.Extensions.Xunit.Hosting/XunitTestLoggerEntry.cs#L27
Added line #L27 was not covered by tests

src/Codebelt.Extensions.Xunit.Hosting.AspNetCore/Http/Features/FakeHttpResponseFeature.cs (1)

30-35: Some lines in the OnStarting method are not covered by tests.

Static analysis hints indicate that lines 31, 33, and 35 in the OnStarting method are not covered by tests. It's important to ensure that all code paths are properly tested to maintain a high-quality codebase.

Please consider adding tests to cover these lines. If you need assistance with writing the tests, let me know and I'll be happy to help.

Tools
GitHub Check: codecov/patch

[warning] 31-31: src/Codebelt.Extensions.Xunit.Hosting.AspNetCore/Http/Features/FakeHttpResponseFeature.cs#L31
Added line #L31 was not covered by tests


[warning] 33-33: src/Codebelt.Extensions.Xunit.Hosting.AspNetCore/Http/Features/FakeHttpResponseFeature.cs#L33
Added line #L33 was not covered by tests


[warning] 35-35: src/Codebelt.Extensions.Xunit.Hosting.AspNetCore/Http/Features/FakeHttpResponseFeature.cs#L35
Added line #L35 was not covered by tests

src/Codebelt.Extensions.Xunit.Hosting/LoggerExtensions.cs (1)

25-48: LGTM with suggestions for improving robustness and maintainability.

The method implementation looks good and provides a convenient way to retrieve the test store associated with the logger in an xUnit testing context. However, consider the following suggestions to improve the robustness and maintainability of the code:

  1. The use of reflection to access internal fields and properties of the logger could potentially break if the internal implementation of the logger changes in future versions of the logging framework. Consider adding a comment to document this assumption and potential fragility.

  2. The method assumes that the test store is of type InMemoryTestStore<XunitTestLoggerEntry>. If the implementation of the test store changes in future versions, this method may need to be updated. Consider adding a comment to document this assumption.

  3. Consider extracting the reflection logic into separate private methods to improve readability and maintainability of the code.

Tools
GitHub Check: codecov/patch

[warning] 44-47: src/Codebelt.Extensions.Xunit.Hosting/LoggerExtensions.cs#L44-L47
Added lines #L44 - L47 were not covered by tests

src/Codebelt.Extensions.Xunit/InMemoryTestStore.cs (3)

28-34: Add tests for the Count property.

The InnerStore property correctly returns the reference to the private _store field, and the Count property correctly returns the count of items in the store.

However, the Count property is not covered by tests according to the static analysis hints. Please add tests to ensure that the Count property returns the correct value.

Do you want me to generate the unit testing code or open a GitHub issue to track this task?

Tools
GitHub Check: codecov/patch

[warning] 28-28: src/Codebelt.Extensions.Xunit/InMemoryTestStore.cs#L28
Added line #L28 was not covered by tests


[warning] 34-34: src/Codebelt.Extensions.Xunit/InMemoryTestStore.cs#L34
Added line #L34 was not covered by tests


50-53: Consider using a simple if-else statement for better readability.

The Query method correctly filters the items based on the provided predicate. However, the use of Condition.TernaryIf may be harder to understand compared to a simple if-else statement.

Consider applying this diff to improve readability:

-return Condition.TernaryIf(predicate == null, () => _store, () => _store.Where(predicate!));
+if (predicate == null)
+{
+    return _store;
+}
+else
+{
+    return _store.Where(predicate);
+}

60-63: Add tests for the QueryFor method.

The QueryFor method correctly filters the items based on the type TResult and casts the result to TResult.

However, the method is not covered by tests according to the static analysis hints. Please add tests to ensure that the QueryFor method returns the correct result.

Do you want me to generate the unit testing code or open a GitHub issue to track this task?

Tools
GitHub Check: codecov/patch

[warning] 61-61: src/Codebelt.Extensions.Xunit/InMemoryTestStore.cs#L61
Added line #L61 was not covered by tests

.nuget/Codebelt.Extensions.Xunit.Hosting.AspNetCore/README.md (1)

1-61: LGTM! The README.md file provides a comprehensive overview of the library.

The file effectively introduces the Codebelt.Extensions.Xunit.Hosting.AspNetCore library, highlighting its purpose, compatibility, and integration with ASP.NET Core and Microsoft Dependency Injection. The provided information is clear, concise, and well-structured.

The inclusion of a C# example is particularly valuable, as it demonstrates practical application and testing methodologies, serving as a guide for developers to implement similar testing scenarios in their projects.

The links to related packages and documentation enhance accessibility for developers seeking to implement or understand the library's functionalities.

Consider adding a table of contents to improve navigation within the file, especially as the documentation grows over time.

src/Codebelt.Extensions.Xunit.Hosting/ServiceCollectionExtensions.cs (2)

44-47: Add tests to cover this method.

The added lines in this method are not covered by tests, which could lead to undetected bugs or regressions.

Do you want me to generate the unit testing code or open a GitHub issue to track this task?

Tools
GitHub Check: codecov/patch

[warning] 44-47: src/Codebelt.Extensions.Xunit.Hosting/ServiceCollectionExtensions.cs#L44-L47
Added lines #L44 - L47 were not covered by tests


59-63: Add tests to cover this method.

The added lines in this method are not covered by tests, which could lead to undetected bugs or regressions.

Do you want me to generate the unit testing code or open a GitHub issue to track this task?

Tools
GitHub Check: codecov/patch

[warning] 59-63: src/Codebelt.Extensions.Xunit.Hosting/ServiceCollectionExtensions.cs#L59-L63
Added lines #L59 - L63 were not covered by tests

CHANGELOG.md (3)

7-8: Consider rephrasing the note about changelog entries.

The phrase "prior to" in the note might be wordy. Consider using a shorter alternative for better readability.

-Changelog entries prior to version 8.4.0 was migrated from previous versions of Cuemon.Extensions.Xunit, Cuemon.Extensions.Xunit.Hosting, and Cuemon.Extensions.Xunit.Hosting.AspNetCore.
+Changelog entries before version 8.4.0 were migrated from previous versions of Cuemon.Extensions.Xunit, Cuemon.Extensions.Xunit.Hosting, and Cuemon.Extensions.Xunit.Hosting.AspNetCore.
Tools
LanguageTool

[style] ~8-~8: ‘prior to’ might be wordy. Consider a shorter alternative.
Context: ...er.

[!NOTE]
Changelog entries prior to version 8.4.0 was migrated from previou...

(EN_WORDINESS_PREMIUM_PRIOR_TO)


34-39: Consider rephrasing the dependency update descriptions.

The phrase "with respect to" in the dependency update descriptions might be wordy. Consider using a shorter alternative for better readability.

-Codebelt.Extensions.Xunit updated to latest and greatest with respect to TFMs
+Codebelt.Extensions.Xunit updated to the latest TFMs
-Codebelt.Extensions.Xunit.Hosting updated to latest and greatest with respect to TFMs
+Codebelt.Extensions.Xunit.Hosting updated to the latest TFMs
-Codebelt.Extensions.Xunit.Hosting.AspNetCore updated to latest and greatest with respect to TFMs
+Codebelt.Extensions.Xunit.Hosting.AspNetCore updated to the latest TFMs
-Codebelt.Extensions.Xunit.Hosting.AspNetCore.Mvc updated to latest and greatest with respect to TFMs
+Codebelt.Extensions.Xunit.Hosting.AspNetCore.Mvc updated to the latest TFMs
Tools
LanguageTool

[style] ~36-~36: ‘with respect to’ might be wordy. Consider a shorter alternative.
Context: ...ns.Xunit updated to latest and greatest with respect to TFMs

  • Codebelt.Extensions.Xunit.Hosti...

(EN_WORDINESS_PREMIUM_WITH_RESPECT_TO)


[style] ~37-~37: ‘with respect to’ might be wordy. Consider a shorter alternative.
Context: ....Hosting updated to latest and greatest with respect to TFMs

  • Codebelt.Extensions.Xunit.Hosti...

(EN_WORDINESS_PREMIUM_WITH_RESPECT_TO)


[style] ~38-~38: ‘with respect to’ might be wordy. Consider a shorter alternative.
Context: ...pNetCore updated to latest and greatest with respect to TFMs

  • Codebelt.Extensions.Xunit.Hosti...

(EN_WORDINESS_PREMIUM_WITH_RESPECT_TO)


[style] ~39-~39: ‘with respect to’ might be wordy. Consider a shorter alternative.
Context: ...Core.Mvc updated to latest and greatest with respect to TFMs

Removed

  • TFM net7.0 for...

(EN_WORDINESS_PREMIUM_WITH_RESPECT_TO)


47-52: Consider rephrasing the dependency update descriptions.

The phrase "with respect to" in the dependency update descriptions might be wordy. Consider using a shorter alternative for better readability.

-Codebelt.Extensions.Xunit updated to latest and greatest with respect to TFMs
+Codebelt.Extensions.Xunit updated to the latest TFMs
-Codebelt.Extensions.Xunit.Hosting updated to latest and greatest with respect to TFMs
+Codebelt.Extensions.Xunit.Hosting updated to the latest TFMs
-Codebelt.Extensions.Xunit.Hosting.AspNetCore updated to latest and greatest with respect to TFMs
+Codebelt.Extensions.Xunit.Hosting.AspNetCore updated to the latest TFMs
-Codebelt.Extensions.Xunit.Hosting.AspNetCore.Mvc updated to latest and greatest with respect to TFMs
+Codebelt.Extensions.Xunit.Hosting.AspNetCore.Mvc updated to the latest TFMs
Tools
LanguageTool

[style] ~49-~49: ‘with respect to’ might be wordy. Consider a shorter alternative.
Context: ...ns.Xunit updated to latest and greatest with respect to TFMs

  • Codebelt.Extensions.Xunit.Hosti...

(EN_WORDINESS_PREMIUM_WITH_RESPECT_TO)


[style] ~50-~50: ‘with respect to’ might be wordy. Consider a shorter alternative.
Context: ....Hosting updated to latest and greatest with respect to TFMs

  • Codebelt.Extensions.Xunit.Hosti...

(EN_WORDINESS_PREMIUM_WITH_RESPECT_TO)


[style] ~51-~51: ‘with respect to’ might be wordy. Consider a shorter alternative.
Context: ...pNetCore updated to latest and greatest with respect to TFMs

  • Codebelt.Extensions.Xunit.Hosti...

(EN_WORDINESS_PREMIUM_WITH_RESPECT_TO)


[style] ~52-~52: ‘with respect to’ might be wordy. Consider a shorter alternative.
Context: ...Core.Mvc updated to latest and greatest with respect to TFMs

Added

  • IWebHostTest int...

(EN_WORDINESS_PREMIUM_WITH_RESPECT_TO)

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 6a868e3 and b65375d.

Files selected for processing (82)
  • .docfx/BuildDocfxImage.ps1 (1 hunks)
  • .docfx/Dockerfile.docfx (1 hunks)
  • .docfx/PublishDocfxImage.ps1 (1 hunks)
  • .docfx/api/namespaces/Codebelt.Extensions.Xunit.Hosting.AspNetCore.Http.Features.md (1 hunks)
  • .docfx/api/namespaces/Codebelt.Extensions.Xunit.Hosting.AspNetCore.Http.md (1 hunks)
  • .docfx/api/namespaces/Codebelt.Extensions.Xunit.Hosting.AspNetCore.md (1 hunks)
  • .docfx/api/namespaces/Codebelt.Extensions.Xunit.Hosting.md (1 hunks)
  • .docfx/api/namespaces/Codebelt.Extensions.Xunit.md (1 hunks)
  • .docfx/docfx.json (3 hunks)
  • .docfx/includes/availability-default.md (1 hunks)
  • .docfx/includes/availability-modern.md (1 hunks)
  • .docfx/index.md (1 hunks)
  • .docfx/toc.yml (1 hunks)
  • .github/dependabot.yml (0 hunks)
  • .github/workflows/pipelines.yml (3 hunks)
  • .nuget/ClassLibrary1/PackageReleaseNotes.txt (0 hunks)
  • .nuget/ClassLibrary1/README.md (0 hunks)
  • .nuget/Codebelt.Extensions.Xunit.App/PackageReleaseNotes.txt (1 hunks)
  • .nuget/Codebelt.Extensions.Xunit.App/README.md (1 hunks)
  • .nuget/Codebelt.Extensions.Xunit.Hosting.AspNetCore/PackageReleaseNotes.txt (1 hunks)
  • .nuget/Codebelt.Extensions.Xunit.Hosting.AspNetCore/README.md (1 hunks)
  • .nuget/Codebelt.Extensions.Xunit.Hosting/PackageReleaseNotes.txt (1 hunks)
  • .nuget/Codebelt.Extensions.Xunit.Hosting/README.md (1 hunks)
  • .nuget/Codebelt.Extensions.Xunit/PackageReleaseNotes.txt (1 hunks)
  • .nuget/Codebelt.Extensions.Xunit/README.md (1 hunks)
  • CHANGELOG.md (1 hunks)
  • ClassLibrary1.sln (0 hunks)
  • Codebelt.Xunit.sln (1 hunks)
  • Directory.Build.props (4 hunks)
  • Directory.Build.targets (1 hunks)
  • src/ClassLibrary1/Class1.cs (0 hunks)
  • src/Codebelt.Extensions.Xunit.App/Codebelt.Extensions.Xunit.App.csproj (1 hunks)
  • src/Codebelt.Extensions.Xunit.Hosting.AspNetCore/AspNetCoreHostFixture.cs (1 hunks)
  • src/Codebelt.Extensions.Xunit.Hosting.AspNetCore/AspNetCoreHostFixtureExtensions.cs (1 hunks)
  • src/Codebelt.Extensions.Xunit.Hosting.AspNetCore/AspNetCoreHostTest.cs (1 hunks)
  • src/Codebelt.Extensions.Xunit.Hosting.AspNetCore/Codebelt.Extensions.Xunit.Hosting.AspNetCore.csproj (1 hunks)
  • src/Codebelt.Extensions.Xunit.Hosting.AspNetCore/Http/FakeHttpContextAccessor.cs (1 hunks)
  • src/Codebelt.Extensions.Xunit.Hosting.AspNetCore/Http/Features/FakeHttpRequestFeature.cs (1 hunks)
  • src/Codebelt.Extensions.Xunit.Hosting.AspNetCore/Http/Features/FakeHttpResponseFeature.cs (1 hunks)
  • src/Codebelt.Extensions.Xunit.Hosting.AspNetCore/HttpClientExtensions.cs (1 hunks)
  • src/Codebelt.Extensions.Xunit.Hosting.AspNetCore/IAspNetCoreHostFixture.cs (1 hunks)
  • src/Codebelt.Extensions.Xunit.Hosting.AspNetCore/IPipelineTest.cs (1 hunks)
  • src/Codebelt.Extensions.Xunit.Hosting.AspNetCore/IWebHostTest.cs (1 hunks)
  • src/Codebelt.Extensions.Xunit.Hosting.AspNetCore/Properties/AssemblyInfo.cs (1 hunks)
  • src/Codebelt.Extensions.Xunit.Hosting.AspNetCore/ServiceCollectionExtensions.cs (1 hunks)
  • src/Codebelt.Extensions.Xunit.Hosting.AspNetCore/WebHostTest.cs (1 hunks)
  • src/Codebelt.Extensions.Xunit.Hosting.AspNetCore/WebHostTestFactory.cs (1 hunks)
  • src/Codebelt.Extensions.Xunit.Hosting/Codebelt.Extensions.Xunit.Hosting.csproj (1 hunks)
  • src/Codebelt.Extensions.Xunit.Hosting/GenericHostTest.cs (1 hunks)
  • src/Codebelt.Extensions.Xunit.Hosting/GenericHostTestFactory.cs (1 hunks)
  • src/Codebelt.Extensions.Xunit.Hosting/HostFixture.cs (1 hunks)
  • src/Codebelt.Extensions.Xunit.Hosting/HostFixtureExtensions.cs (1 hunks)
  • src/Codebelt.Extensions.Xunit.Hosting/HostTest.cs (1 hunks)
  • src/Codebelt.Extensions.Xunit.Hosting/IConfigurationTest.cs (1 hunks)
  • src/Codebelt.Extensions.Xunit.Hosting/IGenericHostTest.cs (1 hunks)
  • src/Codebelt.Extensions.Xunit.Hosting/IHostFixture.cs (1 hunks)
  • src/Codebelt.Extensions.Xunit.Hosting/IHostTest.cs (1 hunks)
  • src/Codebelt.Extensions.Xunit.Hosting/IHostingEnvironmentTest.cs (1 hunks)
  • src/Codebelt.Extensions.Xunit.Hosting/IServiceTest.cs (1 hunks)
  • src/Codebelt.Extensions.Xunit.Hosting/LoggerExtensions.cs (1 hunks)
  • src/Codebelt.Extensions.Xunit.Hosting/Properties/AssemblyInfo.cs (1 hunks)
  • src/Codebelt.Extensions.Xunit.Hosting/ServiceCollectionExtensions.cs (1 hunks)
  • src/Codebelt.Extensions.Xunit.Hosting/ServiceProviderExtensions.cs (1 hunks)
  • src/Codebelt.Extensions.Xunit.Hosting/XunitTestLogger.cs (1 hunks)
  • src/Codebelt.Extensions.Xunit.Hosting/XunitTestLoggerEntry.cs (1 hunks)
  • src/Codebelt.Extensions.Xunit.Hosting/XunitTestLoggerProvider.cs (1 hunks)
  • src/Codebelt.Extensions.Xunit/Codebelt.Extensions.Xunit.csproj (1 hunks)
  • src/Codebelt.Extensions.Xunit/ITest.cs (1 hunks)
  • src/Codebelt.Extensions.Xunit/ITestOutputHelperAccessor.cs (1 hunks)
  • src/Codebelt.Extensions.Xunit/ITestStore.cs (1 hunks)
  • src/Codebelt.Extensions.Xunit/InMemoryTestStore.cs (1 hunks)
  • src/Codebelt.Extensions.Xunit/Properties/AssemblyInfo.cs (1 hunks)
  • src/Codebelt.Extensions.Xunit/Test.cs (1 hunks)
  • src/Codebelt.Extensions.Xunit/TestOutputHelperAccessor.cs (1 hunks)
  • src/Codebelt.Extensions.Xunit/TestOutputHelperExtensions.cs (1 hunks)
  • src/Codebelt.Extensions.Xunit/WildcardOptions.cs (1 hunks)
  • test/Codebelt.Extensions.Xunit.Hosting.AspNetCore.Tests/AspNetCoreHostTestTest.cs (1 hunks)
  • test/Codebelt.Extensions.Xunit.Hosting.AspNetCore.Tests/Assets/BoolMiddleware.cs (1 hunks)
  • test/Codebelt.Extensions.Xunit.Hosting.AspNetCore.Tests/Assets/BoolOptions.cs (1 hunks)
  • test/Codebelt.Extensions.Xunit.Hosting.AspNetCore.Tests/Codebelt.Extensions.Xunit.Hosting.AspNetCore.Tests.csproj (1 hunks)
  • test/Codebelt.Extensions.Xunit.Hosting.AspNetCore.Tests/WebHostTestFactoryTest.cs (1 hunks)
  • test/Codebelt.Extensions.Xunit.Hosting.Tests/Assets/ScopedCorrelation.cs (1 hunks)
Files not processed due to max files limit (11)
  • test/Codebelt.Extensions.Xunit.Hosting.Tests/Assets/SingletonCorrelation.cs
  • test/Codebelt.Extensions.Xunit.Hosting.Tests/Assets/TransientCorrelation.cs
  • test/Codebelt.Extensions.Xunit.Hosting.Tests/Codebelt.Extensions.Xunit.Hosting.Tests.csproj
  • test/Codebelt.Extensions.Xunit.Hosting.Tests/HostTestTest.cs
  • test/Codebelt.Extensions.Xunit.Hosting.Tests/ServiceCollectionExtensions.cs
  • test/Codebelt.Extensions.Xunit.Hosting.Tests/appsettings.json
  • test/Codebelt.Extensions.Xunit.Tests/Codebelt.Extensions.Xunit.Tests.csproj
  • test/Codebelt.Extensions.Xunit.Tests/TestTest.cs
  • test/TestProject1/TestProject1.csproj
  • test/TestProject1/UnitTest1.cs
  • testenvironments.json
Files not reviewed due to no reviewable changes (5)
  • .github/dependabot.yml
  • .nuget/ClassLibrary1/PackageReleaseNotes.txt
  • .nuget/ClassLibrary1/README.md
  • ClassLibrary1.sln
  • src/ClassLibrary1/Class1.cs
Files skipped from review due to trivial changes (9)
  • .docfx/api/namespaces/Codebelt.Extensions.Xunit.Hosting.AspNetCore.Http.Features.md
  • .docfx/includes/availability-default.md
  • .docfx/includes/availability-modern.md
  • .docfx/index.md
  • .docfx/toc.yml
  • Codebelt.Xunit.sln
  • src/Codebelt.Extensions.Xunit.Hosting.AspNetCore/Properties/AssemblyInfo.cs
  • src/Codebelt.Extensions.Xunit.Hosting/Properties/AssemblyInfo.cs
  • src/Codebelt.Extensions.Xunit/Properties/AssemblyInfo.cs
Additional context used
GitHub Check: codecov/patch
src/Codebelt.Extensions.Xunit.Hosting/XunitTestLoggerProvider.cs

[warning] 18-21: src/Codebelt.Extensions.Xunit.Hosting/XunitTestLoggerProvider.cs#L18-L21
Added lines #L18 - L21 were not covered by tests


[warning] 31-32: src/Codebelt.Extensions.Xunit.Hosting/XunitTestLoggerProvider.cs#L31-L32
Added lines #L31 - L32 were not covered by tests

src/Codebelt.Extensions.Xunit.Hosting/ServiceProviderExtensions.cs

[warning] 19-22: src/Codebelt.Extensions.Xunit.Hosting/ServiceProviderExtensions.cs#L19-L22
Added lines #L19 - L22 were not covered by tests

src/Codebelt.Extensions.Xunit.Hosting/XunitTestLogger.cs

[warning] 18-21: src/Codebelt.Extensions.Xunit.Hosting/XunitTestLogger.cs#L18-L21
Added lines #L18 - L21 were not covered by tests


[warning] 30-32: src/Codebelt.Extensions.Xunit.Hosting/XunitTestLogger.cs#L30-L32
Added lines #L30 - L32 were not covered by tests


[warning] 41-43: src/Codebelt.Extensions.Xunit.Hosting/XunitTestLogger.cs#L41-L43
Added lines #L41 - L43 were not covered by tests


[warning] 46-48: src/Codebelt.Extensions.Xunit.Hosting/XunitTestLogger.cs#L46-L48
Added lines #L46 - L48 were not covered by tests


[warning] 51-52: src/Codebelt.Extensions.Xunit.Hosting/XunitTestLogger.cs#L51-L52
Added lines #L51 - L52 were not covered by tests

src/Codebelt.Extensions.Xunit.Hosting/GenericHostTestFactory.cs

[warning] 19-21: src/Codebelt.Extensions.Xunit.Hosting/GenericHostTestFactory.cs#L19-L21
Added lines #L19 - L21 were not covered by tests


[warning] 30-32: src/Codebelt.Extensions.Xunit.Hosting/GenericHostTestFactory.cs#L30-L32
Added lines #L30 - L32 were not covered by tests

src/Codebelt.Extensions.Xunit.Hosting/XunitTestLoggerEntry.cs

[warning] 27-27: src/Codebelt.Extensions.Xunit.Hosting/XunitTestLoggerEntry.cs#L27
Added line #L27 was not covered by tests


[warning] 33-33: src/Codebelt.Extensions.Xunit.Hosting/XunitTestLoggerEntry.cs#L33
Added line #L33 was not covered by tests

src/Codebelt.Extensions.Xunit.Hosting.AspNetCore/Http/Features/FakeHttpResponseFeature.cs

[warning] 31-31: src/Codebelt.Extensions.Xunit.Hosting.AspNetCore/Http/Features/FakeHttpResponseFeature.cs#L31
Added line #L31 was not covered by tests


[warning] 33-33: src/Codebelt.Extensions.Xunit.Hosting.AspNetCore/Http/Features/FakeHttpResponseFeature.cs#L33
Added line #L33 was not covered by tests


[warning] 35-35: src/Codebelt.Extensions.Xunit.Hosting.AspNetCore/Http/Features/FakeHttpResponseFeature.cs#L35
Added line #L35 was not covered by tests

src/Codebelt.Extensions.Xunit.Hosting/LoggerExtensions.cs

[warning] 44-47: src/Codebelt.Extensions.Xunit.Hosting/LoggerExtensions.cs#L44-L47
Added lines #L44 - L47 were not covered by tests

src/Codebelt.Extensions.Xunit/InMemoryTestStore.cs

[warning] 28-28: src/Codebelt.Extensions.Xunit/InMemoryTestStore.cs#L28
Added line #L28 was not covered by tests


[warning] 34-34: src/Codebelt.Extensions.Xunit/InMemoryTestStore.cs#L34
Added line #L34 was not covered by tests


[warning] 61-61: src/Codebelt.Extensions.Xunit/InMemoryTestStore.cs#L61
Added line #L61 was not covered by tests

src/Codebelt.Extensions.Xunit.Hosting/GenericHostTest.cs

[warning] 16-18: src/Codebelt.Extensions.Xunit.Hosting/GenericHostTest.cs#L16-L18
Added lines #L16 - L18 were not covered by tests


[warning] 20-29: src/Codebelt.Extensions.Xunit.Hosting/GenericHostTest.cs#L20-L29
Added lines #L20 - L29 were not covered by tests


[warning] 32-34: src/Codebelt.Extensions.Xunit.Hosting/GenericHostTest.cs#L32-L34
Added lines #L32 - L34 were not covered by tests


[warning] 36-45: src/Codebelt.Extensions.Xunit.Hosting/GenericHostTest.cs#L36-L45
Added lines #L36 - L45 were not covered by tests


[warning] 48-49: src/Codebelt.Extensions.Xunit.Hosting/GenericHostTest.cs#L48-L49
Added lines #L48 - L49 were not covered by tests


[warning] 52-53: src/Codebelt.Extensions.Xunit.Hosting/GenericHostTest.cs#L52-L53
Added lines #L52 - L53 were not covered by tests


[warning] 55-55: src/Codebelt.Extensions.Xunit.Hosting/GenericHostTest.cs#L55
Added line #L55 was not covered by tests


[warning] 58-58: src/Codebelt.Extensions.Xunit.Hosting/GenericHostTest.cs#L58
Added line #L58 was not covered by tests


[warning] 61-66: src/Codebelt.Extensions.Xunit.Hosting/GenericHostTest.cs#L61-L66
Added lines #L61 - L66 were not covered by tests

src/Codebelt.Extensions.Xunit.Hosting/ServiceCollectionExtensions.cs

[warning] 44-47: src/Codebelt.Extensions.Xunit.Hosting/ServiceCollectionExtensions.cs#L44-L47
Added lines #L44 - L47 were not covered by tests


[warning] 59-63: src/Codebelt.Extensions.Xunit.Hosting/ServiceCollectionExtensions.cs#L59-L63
Added lines #L59 - L63 were not covered by tests

GitHub Check: 🔬 Code Quality Analysis
src/Codebelt.Extensions.Xunit.Hosting/GenericHostTest.cs

[warning] 47-47:
Add a nested comment explaining why this method is empty, throw a 'NotSupportedException' or complete the implementation. (https://rules.sonarsource.com/csharp/RSPEC-1186)


[warning] 47-47:
Add a nested comment explaining why this method is empty, throw a 'NotSupportedException' or complete the implementation. (https://rules.sonarsource.com/csharp/RSPEC-1186)


[warning] 47-47:
Add a nested comment explaining why this method is empty, throw a 'NotSupportedException' or complete the implementation. (https://rules.sonarsource.com/csharp/RSPEC-1186)

src/Codebelt.Extensions.Xunit.Hosting/ServiceCollectionExtensions.cs

[warning] 19-19:
XML comment has a param tag for 'accessor', but there is no parameter by that name


[warning] 19-19:
XML comment has a param tag for 'accessor', but there is no parameter by that name


[warning] 19-19:
XML comment has a param tag for 'accessor', but there is no parameter by that name

src/Codebelt.Extensions.Xunit.Hosting.AspNetCore/WebHostTest.cs

[warning] 56-56:
Add a nested comment explaining why this method is empty, throw a 'NotSupportedException' or complete the implementation. (https://rules.sonarsource.com/csharp/RSPEC-1186)


[warning] 56-56:
Add a nested comment explaining why this method is empty, throw a 'NotSupportedException' or complete the implementation. (https://rules.sonarsource.com/csharp/RSPEC-1186)

src/Codebelt.Extensions.Xunit.Hosting/HostTest.cs

[warning] 29-29:
Remove this call from a constructor to the overridable 'InitializeHostFixture' method. (https://rules.sonarsource.com/csharp/RSPEC-1699)


[warning] 29-29:
Remove this call from a constructor to the overridable 'InitializeHostFixture' method. (https://rules.sonarsource.com/csharp/RSPEC-1699)

GitHub Check: 🛡️ Security Analysis
src/Codebelt.Extensions.Xunit.Hosting/ServiceCollectionExtensions.cs

[warning] 19-19:
XML comment has a param tag for 'accessor', but there is no parameter by that name


[warning] 19-19:
XML comment has a param tag for 'accessor', but there is no parameter by that name

GitHub Check: 🧪 Test (windows-2022, Release)
src/Codebelt.Extensions.Xunit.Hosting/ServiceCollectionExtensions.cs

[warning] 19-19:
XML comment has a param tag for 'accessor', but there is no parameter by that name


[warning] 19-19:
XML comment has a param tag for 'accessor', but there is no parameter by that name


[warning] 19-19:
XML comment has a param tag for 'accessor', but there is no parameter by that name


[warning] 19-19:
XML comment has a param tag for 'accessor', but there is no parameter by that name


[warning] 19-19:
XML comment has a param tag for 'accessor', but there is no parameter by that name


[warning] 19-19:
XML comment has a param tag for 'accessor', but there is no parameter by that name

GitHub Check: 🧪 Test (windows-2022, Debug)
src/Codebelt.Extensions.Xunit.Hosting/ServiceCollectionExtensions.cs

[warning] 19-19:
XML comment has a param tag for 'accessor', but there is no parameter by that name


[warning] 19-19:
XML comment has a param tag for 'accessor', but there is no parameter by that name


[warning] 19-19:
XML comment has a param tag for 'accessor', but there is no parameter by that name


[warning] 19-19:
XML comment has a param tag for 'accessor', but there is no parameter by that name


[warning] 19-19:
XML comment has a param tag for 'accessor', but there is no parameter by that name


[warning] 19-19:
XML comment has a param tag for 'accessor', but there is no parameter by that name

GitHub Check: 🧪 Test (ubuntu-22.04, Release)
src/Codebelt.Extensions.Xunit.Hosting/ServiceCollectionExtensions.cs

[warning] 19-19:
XML comment has a param tag for 'accessor', but there is no parameter by that name


[warning] 19-19:
XML comment has a param tag for 'accessor', but there is no parameter by that name


[warning] 19-19:
XML comment has a param tag for 'accessor', but there is no parameter by that name


[warning] 19-19:
XML comment has a param tag for 'accessor', but there is no parameter by that name

GitHub Check: 🧪 Test (ubuntu-22.04, Debug)
src/Codebelt.Extensions.Xunit.Hosting/ServiceCollectionExtensions.cs

[warning] 19-19:
XML comment has a param tag for 'accessor', but there is no parameter by that name


[warning] 19-19:
XML comment has a param tag for 'accessor', but there is no parameter by that name


[warning] 19-19:
XML comment has a param tag for 'accessor', but there is no parameter by that name


[warning] 19-19:
XML comment has a param tag for 'accessor', but there is no parameter by that name

GitHub Check: 🛠️ Build (Release, netstandard2.0)
src/Codebelt.Extensions.Xunit.Hosting/ServiceCollectionExtensions.cs

[warning] 19-19:
XML comment has a param tag for 'accessor', but there is no parameter by that name


[warning] 19-19:
XML comment has a param tag for 'accessor', but there is no parameter by that name

GitHub Check: 🛠️ Build (Release, net6.0)
src/Codebelt.Extensions.Xunit.Hosting/ServiceCollectionExtensions.cs

[warning] 19-19:
XML comment has a param tag for 'accessor', but there is no parameter by that name


[warning] 19-19:
XML comment has a param tag for 'accessor', but there is no parameter by that name

GitHub Check: 🛠️ Build (Release, net8.0)
src/Codebelt.Extensions.Xunit.Hosting/ServiceCollectionExtensions.cs

[warning] 19-19:
XML comment has a param tag for 'accessor', but there is no parameter by that name


[warning] 19-19:
XML comment has a param tag for 'accessor', but there is no parameter by that name

GitHub Check: 🛠️ Build (Debug, netstandard2.0)
src/Codebelt.Extensions.Xunit.Hosting/ServiceCollectionExtensions.cs

[warning] 19-19:
XML comment has a param tag for 'accessor', but there is no parameter by that name


[warning] 19-19:
XML comment has a param tag for 'accessor', but there is no parameter by that name

GitHub Check: 🛠️ Build (Debug, net6.0)
src/Codebelt.Extensions.Xunit.Hosting/ServiceCollectionExtensions.cs

[warning] 19-19:
XML comment has a param tag for 'accessor', but there is no parameter by that name


[warning] 19-19:
XML comment has a param tag for 'accessor', but there is no parameter by that name

GitHub Check: 🛠️ Build (Debug, net8.0)
src/Codebelt.Extensions.Xunit.Hosting/ServiceCollectionExtensions.cs

[warning] 19-19:
XML comment has a param tag for 'accessor', but there is no parameter by that name


[warning] 19-19:
XML comment has a param tag for 'accessor', but there is no parameter by that name

LanguageTool
CHANGELOG.md

[style] ~8-~8: ‘prior to’ might be wordy. Consider a shorter alternative.
Context: ...er.

[!NOTE]
Changelog entries prior to version 8.4.0 was migrated from previou...

(EN_WORDINESS_PREMIUM_PRIOR_TO)


[style] ~36-~36: ‘with respect to’ might be wordy. Consider a shorter alternative.
Context: ...ns.Xunit updated to latest and greatest with respect to TFMs

  • Codebelt.Extensions.Xunit.Hosti...

(EN_WORDINESS_PREMIUM_WITH_RESPECT_TO)


[style] ~37-~37: ‘with respect to’ might be wordy. Consider a shorter alternative.
Context: ....Hosting updated to latest and greatest with respect to TFMs

  • Codebelt.Extensions.Xunit.Hosti...

(EN_WORDINESS_PREMIUM_WITH_RESPECT_TO)


[style] ~38-~38: ‘with respect to’ might be wordy. Consider a shorter alternative.
Context: ...pNetCore updated to latest and greatest with respect to TFMs

  • Codebelt.Extensions.Xunit.Hosti...

(EN_WORDINESS_PREMIUM_WITH_RESPECT_TO)


[style] ~39-~39: ‘with respect to’ might be wordy. Consider a shorter alternative.
Context: ...Core.Mvc updated to latest and greatest with respect to TFMs

Removed

  • TFM net7.0 for...

(EN_WORDINESS_PREMIUM_WITH_RESPECT_TO)


[style] ~49-~49: ‘with respect to’ might be wordy. Consider a shorter alternative.
Context: ...ns.Xunit updated to latest and greatest with respect to TFMs

  • Codebelt.Extensions.Xunit.Hosti...

(EN_WORDINESS_PREMIUM_WITH_RESPECT_TO)


[style] ~50-~50: ‘with respect to’ might be wordy. Consider a shorter alternative.
Context: ....Hosting updated to latest and greatest with respect to TFMs

  • Codebelt.Extensions.Xunit.Hosti...

(EN_WORDINESS_PREMIUM_WITH_RESPECT_TO)


[style] ~51-~51: ‘with respect to’ might be wordy. Consider a shorter alternative.
Context: ...pNetCore updated to latest and greatest with respect to TFMs

  • Codebelt.Extensions.Xunit.Hosti...

(EN_WORDINESS_PREMIUM_WITH_RESPECT_TO)


[style] ~52-~52: ‘with respect to’ might be wordy. Consider a shorter alternative.
Context: ...Core.Mvc updated to latest and greatest with respect to TFMs

Added

  • IWebHostTest int...

(EN_WORDINESS_PREMIUM_WITH_RESPECT_TO)

actionlint
.github/workflows/pipelines.yml

56-56: shellcheck reported issue in this script: SC2086:info:6:56: Double quote to prevent globbing and word splitting

(shellcheck)


56-56: shellcheck reported issue in this script: SC2086:info:8:38: Double quote to prevent globbing and word splitting

(shellcheck)

Additional comments not posted (161)
.docfx/PublishDocfxImage.ps1 (3)

1-1: Clarify the purpose and impact of the new minver flags.

The minver command has been updated to include the -t v -v w flags. Please provide more context on the purpose of these flags and how they affect the generated version string.

Also, consider the potential impact on downstream processes that may rely on a specific version string format.


2-2: LGTM! Verify consistent updates across the codebase and documentation.

The rebranding of the Docker image from sharedkernel-docfx to xunit-docfx and the update to the target repository align with the overall objective of the PR.

Please ensure that all references to the old image name and repository are updated consistently across the codebase and documentation to avoid any broken links or confusion.


3-3: LGTM!

The update to the docker push command aligns with the rebranding of the Docker image and the change in the target repository.

test/Codebelt.Extensions.Xunit.Hosting.Tests/Assets/ScopedCorrelation.cs (1)

5-7: LGTM!

The ScopedCorrelation class is a well-designed sealed record that inherits from CorrelationToken. It is likely intended for use in scenarios where tracking or managing correlation identifiers is necessary within a scoped context.

The class being a sealed record ensures that it is immutable and provides value-based equality, which enhances its utility in scenarios where correlation tokens need to be compared or stored efficiently.

The class expands the functionality of the existing correlation token system, allowing for more specific implementations that can be utilized in unit tests or other hosting scenarios within the Xunit framework.

.docfx/BuildDocfxImage.ps1 (2)

1-1: Improved versioning command.

The addition of the -t v and -v w flags to the minver command enhances the versioning process:

  • The -t v flag adds a v prefix to the generated version string, making it more distinguishable and following a common convention.
  • The -v w flag likely sets the verbosity to include warnings, providing more information during the versioning process.

These changes contribute to a more structured and informative versioning approach.


3-3: Transition to multi-platform Docker builds.

The switch from docker build to docker buildx build is a significant improvement that enables multi-platform support:

  • Specifying --platform linux/arm64,linux/amd64 ensures that the Docker image is compatible with both ARM64 and AMD64 architectures, expanding the deployment options.
  • The --load flag conveniently loads the built image into the local Docker daemon, streamlining development and testing.

These changes enhance the flexibility and usability of the Docker image building process.

.docfx/Dockerfile.docfx (3)

1-1: Excellent choice of base image!

Updating to nginx:1.27.0-alpine brings several benefits:

  • Performance improvements, bug fixes, and security enhancements from the newer Nginx version.
  • Reduced image size, faster build times, and smaller attack surface due to the use of the Alpine variant.

4-4: Great move to a specialized DocFx image!

Switching to codebeltnet/docfx:2.77.0 for the build stage offers several advantages:

  • Simplifies the build process by eliminating the need for extensive setup commands, as the image likely comes pre-configured with the necessary dependencies and tools.
  • Ensures a consistent and reproducible build environment across different systems.

8-9: Documentation build command remains intact.

The core functionality of building the documentation using docfx build remains unchanged, which is good to see.

The removal of the comments regarding DocFx maturity and Visual Studio 2019 requirements suggests potential improvements or changes in the approach to using DocFx within the Docker environment.

src/Codebelt.Extensions.Xunit.Hosting/HostFixtureExtensions.cs (1)

1-10: LGTM!

The new HostFixtureExtensions class and the HasValidState extension method are well-defined and implemented correctly. The method provides a useful utility to check the validity of an IHostFixture instance by verifying the presence of critical properties. The naming is clear, and the functionality enhances the host fixture management in the context of Xunit testing.

test/Codebelt.Extensions.Xunit.Hosting.AspNetCore.Tests/Assets/BoolOptions.cs (1)

1-19: LGTM!

The BoolOptions class is a well-structured and organized way to encapsulate a set of related configuration options. The use of boolean properties to represent binary options is a common and effective pattern. The class implements the IParameterObject interface, which is likely a requirement for the xUnit hosting framework. The class is located in the Assets namespace, which suggests that it is used for testing purposes. Overall, the code is clear, concise, and follows best practices.

src/Codebelt.Extensions.Xunit.Hosting.AspNetCore/AspNetCoreHostFixtureExtensions.cs (1)

1-10: LGTM!

The new internal static class AspNetCoreHostFixtureExtensions and its extension method HasValidState are well-designed and provide a useful utility for checking the state of IAspNetCoreHostFixture instances.

The class and method are appropriately scoped as internal, ensuring they do not affect the public API. The namespace is also suitable for the functionality.

The HasValidState method enhances the robustness of the hosting framework by providing a straightforward way to verify the readiness of the host fixture before proceeding with service configurations or application execution.

src/Codebelt.Extensions.Xunit.Hosting.AspNetCore/IWebHostTest.cs (1)

1-12: LGTM!

The introduction of the IWebHostTest interface is a great addition to the Codebelt.Extensions.Xunit.Hosting.AspNetCore namespace. It provides a structured approach to testing web host scenarios in ASP.NET Core by encapsulating the necessary members and extending relevant interfaces.

The interface follows the naming convention, is well-documented with XML comments, and promotes code reuse and maintainability. It does not introduce any breaking changes as it is a new addition.

Great work!

.docfx/api/namespaces/Codebelt.Extensions.Xunit.md (2)

1-4: LGTM!

The YAML front matter is correctly formatted, and the uid and summary properties are set appropriately.


5-15: LGTM!

The content provides a clear and concise summary of the Codebelt.Extensions.Xunit namespace. The availability notice, the link to the xUnit documentation, and the table listing the extension methods are helpful for users.

src/Codebelt.Extensions.Xunit.Hosting/IHostTest.cs (1)

8-15: LGTM!

The IHostTest interface is well-designed and enhances the testing capabilities by providing a contract for obtaining an initialized IHost instance. The read-only Host property ensures that the IHost is initialized by the IHostFixture and not modified by the test. The XML documentation provides clear and concise information about the purpose and usage of the interface and its property.

src/Codebelt.Extensions.Xunit/ITest.cs (1)

9-16: LGTM!

The ITest interface is well-designed and documented. It provides a useful abstraction for vanilla testing in the framework.

  • Inheriting from IDisposable is a good practice for classes that need to perform cleanup.
  • The CallerType property is a useful addition for getting the type of the caller, which can be used for logging, debugging, or extending testing capabilities.
  • The default value of CallerType (object.GetType) is a reasonable default.
src/Codebelt.Extensions.Xunit.Hosting/IGenericHostTest.cs (1)

1-15: Excellent addition of the IGenericHostTest interface!

The introduction of the IGenericHostTest interface in the Codebelt.Extensions.Xunit.Hosting namespace is a great design decision. This interface effectively aggregates the functionalities of IServiceTest, IConfigurationTest, IHostingEnvironmentTest, and ITest into a single, cohesive contract.

The benefits of this interface include:

  • Facilitating dependency injection (DI) testing in a minimalistic manner while providing support for the IHost interface from the Microsoft.Extensions.Hosting library.
  • Promoting a consistent and unified approach to testing generic host-related functionalities.
  • Making it easier for developers to implement and manage tests related to generic host scenarios in .NET applications.

The interface is well-documented, follows the project's naming conventions, and is placed in the appropriate namespace. It does not introduce any breaking changes as it is a new addition and does not modify existing interfaces or classes.

Great work on this interface design!

src/Codebelt.Extensions.Xunit/ITestOutputHelperAccessor.cs (1)

1-16: LGTM!

The new interface ITestOutputHelperAccessor is well-designed and documented. It provides a clear and structured way for other components or classes to access and interact with the ITestOutputHelper instance, which is used for outputting test results in the Xunit testing framework.

The interface follows the naming convention, and the XML documentation provides clear and concise information about its purpose and usage. This addition enhances the extensibility and usability of the testing framework within the Codebelt.Extensions.Xunit library.

.docfx/api/namespaces/Codebelt.Extensions.Xunit.Hosting.AspNetCore.Http.md (1)

1-9: Excellent documentation for the new namespace!

The documentation for the Codebelt.Extensions.Xunit.Hosting.AspNetCore.Http namespace is clear, concise, and informative. It effectively communicates the purpose of the namespace and its relationship with the Microsoft.AspNetCore.Http namespace.

The inclusion of the YAML front matter, the main content, the include directive, and the link to the complementary namespace documentation enhances the overall quality and usability of the documentation.

Great job!

src/Codebelt.Extensions.Xunit.Hosting/IServiceTest.cs (1)

1-17: LGTM!

The new IServiceTest interface is a valuable addition to facilitate testing of dependency injection services. The interface is well-designed and properly documented.

Key points:

  • The interface provides a single property ServiceProvider of type IServiceProvider, which allows tests to access the services configured in the DI container.
  • The summary comments clearly explain the purpose of the interface and the ServiceProvider property.
  • The interface is defined in the appropriate namespace Codebelt.Extensions.Xunit.Hosting.

This interface will enhance the testing capabilities for applications using dependency injection, promoting better test isolation and service management.

test/Codebelt.Extensions.Xunit.Hosting.AspNetCore.Tests/Codebelt.Extensions.Xunit.Hosting.AspNetCore.Tests.csproj (3)

1-1: LGTM!

The project file starts with the correct Project element and Sdk attribute for a .NET project.


3-6: LGTM!

The PropertyGroup element correctly specifies the target frameworks and root namespace for the project.


13-15: LGTM!

The ProjectReference element correctly references the source project for the Codebelt.Extensions.Xunit.Hosting.AspNetCore library, allowing the test project to access and test the code in the source project.

src/Codebelt.Extensions.Xunit.Hosting/IConfigurationTest.cs (1)

1-17: LGTM!

The IConfigurationTest interface is a well-designed addition to the framework, providing a standardized way to access configuration settings during testing. The interface is properly documented, follows naming conventions, and is located in an appropriate namespace.

The read-only Configuration property of type IConfiguration ensures that test classes can access the necessary configuration settings without modifying them, promoting better organization and maintainability of test code.

The interface integrates well with the existing IHost interface, ensuring compatibility with the .NET Core hosting model.

Overall, this is a valuable addition to the framework that enhances the testing capabilities for components that rely on configuration settings.

src/Codebelt.Extensions.Xunit.Hosting.AspNetCore/IPipelineTest.cs (1)

1-17: LGTM!

The new IPipelineTest interface is well-defined and follows the standard naming convention for interfaces. The Application property provides a clear contract for accessing the initialized IApplicationBuilder instance, which is essential for ASP.NET Core pipeline testing.

The XML documentation comments are clear, concise, and provide helpful information about the purpose of the interface and its property.

Overall, this is a great addition that enhances the testing capabilities for ASP.NET Core applications.

src/Codebelt.Extensions.Xunit.Hosting.AspNetCore/IAspNetCoreHostFixture.cs (1)

1-18: LGTM!

The IAspNetCoreHostFixture interface is well-designed and serves a clear purpose in facilitating unit testing for ASP.NET Core applications. Key observations:

  • Extending IHostFixture and IPipelineTest interfaces allows for seamless integration with existing hosting and testing functionalities.
  • The ConfigureApplicationCallback property provides flexibility in customizing the HTTP request pipeline during testing, enabling developers to mimic various application states or configurations.

Overall, this interface lays a solid foundation for integrating ASP.NET Core's dependency injection and middleware configuration into unit testing scenarios, promoting better testing practices and more robust application development.

.docfx/api/namespaces/Codebelt.Extensions.Xunit.Hosting.md (3)

1-4: LGTM!

The YAML front matter is correctly specified for the namespace being documented.


5-5: LGTM!

The namespace summary provides a clear and concise description of the purpose of the Codebelt.Extensions.Xunit.Hosting namespace and its relation to the Xunit.Abstractions namespace.


13-17: LGTM!

The extension methods table accurately lists the methods provided by the Codebelt.Extensions.Xunit.Hosting namespace, along with the types they extend.

src/Codebelt.Extensions.Xunit/Codebelt.Extensions.Xunit.csproj (5)

1-1: LGTM!

Using the Microsoft.NET.Sdk is the correct way to define a .NET project.


3-5: LGTM!

Defining a unique ProjectGuid is a good practice, and the GUID format is correct.


7-10: LGTM!

The project description and package tags provide a clear overview of the project's purpose and categorization within the testing domain.


12-16: LGTM!

The package references are appropriate for the project's purpose and the versions are consistent with the overall project version.


18-18: LGTM!

The closing project tag is correctly placed and matches the opening tag.

.docfx/api/namespaces/Codebelt.Extensions.Xunit.Hosting.AspNetCore.md (1)

1-16: Excellent documentation for the new namespace!

The documentation file for the Codebelt.Extensions.Xunit.Hosting.AspNetCore namespace is well-structured and follows the expected format for API documentation. The content provides a clear overview of the namespace's purpose, its relation to other namespaces, and the extension methods it contains.

The AI-generated summary aligns with the content of the file and provides additional insights into the functionality and purpose of the namespace, making it easier for developers to understand how to use it effectively.

Great job on creating comprehensive and informative documentation!

src/Codebelt.Extensions.Xunit.Hosting.AspNetCore/Http/Features/FakeHttpRequestFeature.cs (1)

1-23: Great addition for enhancing testing capabilities!

The FakeHttpRequestFeature class provides a valuable tool for testing components that rely on HTTP request features without the need for a real web server or client. By extending HttpRequestFeature and initializing default values in the constructor, it creates a controlled environment that simulates a basic HTTP request.

This addition aligns well with the goal of facilitating easier and more controlled testing of ASP.NET Core components.

.nuget/Codebelt.Extensions.Xunit.App/PackageReleaseNotes.txt (1)

1-36: Release notes look good!

The release notes provide a clear and concise overview of the changes across multiple versions of the Codebelt.Extensions.Xunit.App package. The focus on updating dependencies and aligning with the latest Target Framework Monikers (TFMs) demonstrates a commitment to maintaining compatibility with modern standards.

A few points to note:

  1. Version 8.4.0 ensures compatibility with the latest TFMs for .NET 8 and .NET 6.
  2. Version 8.3.2 removes support for .NET 7, indicating a shift in focus towards more current frameworks.
  3. Versions 8.2.0 through 8.0.0 consistently update dependencies to stay up-to-date with the latest standards.

Users should be mindful of the specific version compatibility when upgrading or using the package to ensure their projects align with the supported frameworks.

Overall, the release notes effectively communicate the changes and provide users with a clear understanding of the package's evolution.

src/Codebelt.Extensions.Xunit.App/Codebelt.Extensions.Xunit.App.csproj (3)

4-4: Appropriate target frameworks selected.

The project targets .NET 8.0 and .NET 6.0, which are the latest LTS and current versions of the .NET framework. This ensures compatibility with a wide range of .NET applications.


8-12: Project configuration is suitable for a class library.

The IncludeBuildOutput and IncludeSymbols properties are correctly set to false, as this project is a class library that is not intended to be directly executed. The Description property provides a clear and concise summary of the project's purpose.


14-18: Project references are appropriate.

The project includes references to three other related projects within the Codebelt.Extensions.Xunit ecosystem. This indicates that the project is part of a larger suite of tools designed to facilitate xUnit testing in .NET applications. The references appear to be correctly specified.

Directory.Build.targets (1)

22-22: Removed target CoverletGetPathMap. Please clarify the reasoning and impact.

I noticed that the CoverletGetPathMap target has been removed from the Directory.Build.targets file. This target was previously responsible for initializing a source root mapping based on the condition $(DeterministicSourcePaths) being set to true.

Could you please provide some context around the decision to remove this target? Is the deterministic source paths feature no longer needed, or is it being handled differently now?

Also, what impact, if any, do you anticipate this removal will have on the build process and the resulting artifacts?

src/Codebelt.Extensions.Xunit.Hosting/IHostingEnvironmentTest.cs (1)

1-24: LGTM!

The IHostingEnvironmentTest interface is well-designed and enhances the testing capabilities for hosting environments in .NET applications. The key observations are:

  • The interface is properly documented with XML comments, clearly explaining its purpose and members.
  • The conditional compilation directives ensure compatibility across different .NET versions by exposing the appropriate hosting environment type based on the target framework.
  • The interface follows a clear naming convention and adheres to the standard C# coding style.

The introduction of this interface will facilitate effective DI testing for hosting environments in .NET applications while providing flexibility and compatibility across different .NET versions.

src/Codebelt.Extensions.Xunit.Hosting/XunitTestLoggerProvider.cs (1)

7-33: Great job implementing the XunitTestLoggerProvider class!

The class is well-structured and follows best practices:

  • Implements the ILoggerProvider interface correctly.
  • Uses ConcurrentDictionary for thread-safe access to loggers.
  • Provides flexibility in initialization through two constructors.
  • Ensures a single instance of XunitTestLogger per category in the CreateLogger method.

The class provides a clean and efficient way to integrate logging into xUnit tests.

Tools
GitHub Check: codecov/patch

[warning] 18-21: src/Codebelt.Extensions.Xunit.Hosting/XunitTestLoggerProvider.cs#L18-L21
Added lines #L18 - L21 were not covered by tests


[warning] 31-32: src/Codebelt.Extensions.Xunit.Hosting/XunitTestLoggerProvider.cs#L31-L32
Added lines #L31 - L32 were not covered by tests

src/Codebelt.Extensions.Xunit.Hosting/ServiceProviderExtensions.cs (1)

18-22: LGTM!

The extension method GetRequiredScopedService is well-implemented and follows the best practices for retrieving scoped services from the IServiceProvider. The method signature, XML documentation, and exception handling are all properly defined.

The logic of creating a new scope using CreateScope and resolving the service within that scope ensures proper lifetime management and enhances the usability of dependency injection for retrieving scoped services.

Tools
GitHub Check: codecov/patch

[warning] 19-22: src/Codebelt.Extensions.Xunit.Hosting/ServiceProviderExtensions.cs#L19-L22
Added lines #L19 - L22 were not covered by tests

src/Codebelt.Extensions.Xunit/TestOutputHelperAccessor.cs (3)

9-31: LGTM!

The TestOutputHelperAccessor class is well-designed and implemented:

  • It correctly uses AsyncLocal<ITestOutputHelper> to ensure thread-safety and scoping to the current asynchronous context.
  • The constructor and TestOutput property provide a clean way to initialize and access the ITestOutputHelper instance.
  • The class is appropriately documented with XML comments explaining its purpose and usage.

Great job!


17-20: LGTM!

The constructor is well-implemented:

  • It allows for optional initialization of the ITestOutputHelper instance.
  • It correctly sets the provided instance as the current value of the AsyncLocal<ITestOutputHelper>.
  • The parameter is appropriately documented with XML comments.

Good work!


26-30: LGTM!

The TestOutput property is well-implemented:

  • It provides a clean way to access and modify the current ITestOutputHelper instance.
  • The getter and setter correctly interact with the AsyncLocal<ITestOutputHelper> to ensure thread-safety and scoping to the current asynchronous context.
  • The property is appropriately documented with XML comments.

Excellent work!

src/Codebelt.Extensions.Xunit.Hosting.AspNetCore/Http/FakeHttpContextAccessor.cs (3)

12-32: LGTM!

The FakeHttpContextAccessor class is a well-designed unit test implementation of IHttpContextAccessor. It provides a controlled and predictable HttpContext for testing ASP.NET Core applications.

The constructor sets up a FeatureCollection with fake implementations of various HTTP features, enabling developers to simulate different HTTP scenarios without requiring a real web server.

The public HttpContext property allows test cases to access and manipulate the mock context as needed.

Overall, this class enhances the testability of ASP.NET Core applications that depend on IHttpContextAccessor.


18-25: LGTM!

The constructor of FakeHttpContextAccessor sets up a FeatureCollection with fake implementations of various HTTP features, which is essential for simulating different HTTP scenarios in unit tests.

The fake implementations of IHttpResponseFeature, IHttpRequestFeature, and IHttpResponseBodyFeature provide a controlled environment for testing ASP.NET Core applications that depend on these features.

The IHttpResponseBodyFeature is particularly noteworthy as it utilizes a StreamResponseBodyFeature that writes a predefined message to the response body, enabling developers to test their application logic against a known response.

Finally, the HttpContext property is initialized with a DefaultHttpContext that uses the FeatureCollection, ensuring that the mock context is properly set up for testing.


31-31: LGTM!

The HttpContext property of FakeHttpContextAccessor is a crucial component for unit testing ASP.NET Core applications that depend on IHttpContextAccessor.

The property exposes the mock HttpContext to test cases, allowing them to access and manipulate the context as needed. The getter and setter enable test cases to read and modify the HttpContext, providing flexibility in simulating different HTTP scenarios.

The property is initialized in the constructor with a DefaultHttpContext that uses a FeatureCollection with fake HTTP features, ensuring that the mock context is properly set up for testing.

Overall, the HttpContext property enhances the testability of ASP.NET Core applications by providing a controlled and predictable environment for unit tests.

src/Codebelt.Extensions.Xunit.Hosting.AspNetCore/ServiceCollectionExtensions.cs (1)

19-33: LGTM!

The AddFakeHttpContextAccessor method is a well-designed extension method that enhances the testability of components relying on IHttpContextAccessor. It follows best practices by:

  • Providing clear XML documentation explaining the purpose and usage of the method.
  • Using TryAdd to prevent duplicate service registrations.
  • Allowing dependency injection within the fake context by setting HttpContext.RequestServices to the service provider.
  • Following the convention of returning IServiceCollection for fluent chaining of service registrations.
  • Adhering to the Single Responsibility Principle by encapsulating the functionality within the ServiceCollectionExtensions class.

The method provides a convenient way to mock HTTP context behavior during unit testing, improving the overall testability of the codebase.

src/Codebelt.Extensions.Xunit.Hosting.AspNetCore/Codebelt.Extensions.Xunit.Hosting.AspNetCore.csproj (5)

1-7: LGTM!

The project setup looks good:

  • Targeting multiple frameworks ensures compatibility.
  • The project GUID is unique and helps identify the project.
  • Disabling SonarQube for test projects is a common practice.

9-12: LGTM!

The project description and package tags are well-defined:

  • The description provides a clear overview of the project's purpose and its relation to ASP.NET Core and Microsoft Dependency Injection.
  • The package tags are relevant and help with discoverability when publishing the package.

14-24: LGTM!

The framework reference and conditional package references are set up correctly:

  • Including the Microsoft.AspNetCore.App framework reference ensures access to ASP.NET Core functionality.
  • The conditional package references ensure that the appropriate version of Microsoft.AspNetCore.TestHost is used based on the target framework.
  • The package versions are up to date and match the target frameworks.

26-29: LGTM!

The package references are set up correctly:

  • The Cuemon.Extensions.DependencyInjection package provides additional functionality for dependency injection.
  • The Cuemon.IO package provides I/O-related functionality.
  • The package versions are consistent with each other.

31-33: LGTM!

The project reference is set up correctly:

  • The project reference indicates a modular design that allows for shared functionality across projects.
  • The referenced project is located within the same solution.
.nuget/Codebelt.Extensions.Xunit/README.md (1)

1-41: LGTM!

The README.md file is well-structured and provides a comprehensive overview of the Codebelt.Extensions.Xunit library. It clearly states the supported .NET versions, the open-source nature of the project, and the purpose of the library. The links to additional documentation and related packages are helpful for users to explore further. The C# example is a good addition to demonstrate the practical usage of the library.

Overall, the README.md file serves as a good introduction to the library and provides all the necessary information for users to get started. Great job!

src/Codebelt.Extensions.Xunit.Hosting/XunitTestLogger.cs (5)

18-21: LGTM!

The constructor logic is correct, and the implementation is straightforward.

Tools
GitHub Check: codecov/patch

[warning] 18-21: src/Codebelt.Extensions.Xunit.Hosting/XunitTestLogger.cs#L18-L21
Added lines #L18 - L21 were not covered by tests


30-32: LGTM!

The null check and writing to the test output are implemented correctly.

Tools
GitHub Check: codecov/patch

[warning] 30-32: src/Codebelt.Extensions.Xunit.Hosting/XunitTestLogger.cs#L30-L32
Added lines #L30 - L32 were not covered by tests


41-43: LGTM!

The IsEnabled method implementation is correct and follows the expected behavior.

Tools
GitHub Check: codecov/patch

[warning] 41-43: src/Codebelt.Extensions.Xunit.Hosting/XunitTestLogger.cs#L41-L43
Added lines #L41 - L43 were not covered by tests


46-48: LGTM!

The BeginScope method implementation is correct and follows the expected behavior for a no-op scope.

Tools
GitHub Check: codecov/patch

[warning] 46-48: src/Codebelt.Extensions.Xunit.Hosting/XunitTestLogger.cs#L46-L48
Added lines #L46 - L48 were not covered by tests


51-52: LGTM!

The empty Dispose method implementation is acceptable since there are no unmanaged resources to clean up.

Tools
GitHub Check: codecov/patch

[warning] 51-52: src/Codebelt.Extensions.Xunit.Hosting/XunitTestLogger.cs#L51-L52
Added lines #L51 - L52 were not covered by tests

src/Codebelt.Extensions.Xunit.Hosting.AspNetCore/HttpClientExtensions.cs (1)

23-28: LGTM!

The ToHttpResponseMessageAsync extension method is a valuable addition to the HttpClientExtensions class. It provides a convenient way to obtain an HttpResponseMessage from an HttpClient instance, which can be particularly useful in testing scenarios.

The method is well-designed and follows good practices:

  • It accepts an optional responseFactory delegate, allowing flexibility in generating the HttpResponseMessage.
  • It provides a reasonable default behavior of performing a GET request to the root URL ("/") when no responseFactory is provided.
  • It ensures the validity of the HttpClient instance by performing a null check using the Validator.ThrowIfNull method.
  • It utilizes asynchronous programming to return the response, promoting efficient and non-blocking code execution.

Furthermore, the method is well-documented with clear XML comments, making it easy for other developers to understand its purpose and usage. The remarks section also provides guidance on using the method in conjunction with WebHostTestFactory methods, enhancing its usability in testing scenarios.

Overall, this extension method promotes code reuse, reduces duplication, and improves the developer experience when working with HttpClient in testing contexts.

src/Codebelt.Extensions.Xunit/ITestStore.cs (1)

10-37: LGTM!

The ITestStore<T> interface is well-designed and provides a clean API for managing a collection of test-related objects. The Count property and the Add, Query, and QueryFor<TResult> methods offer the necessary functionality for adding and retrieving items from the store.

The interface is also well-documented with XML comments, making it easy to understand and use.

src/Codebelt.Extensions.Xunit.Hosting/XunitTestLoggerEntry.cs (1)

1-50: The XunitTestLoggerEntry record is well-implemented and enhances logging capabilities in unit tests.

The record type is clearly defined with appropriate properties, constructor, and XML documentation. The ToString method override provides a convenient way to represent the log entry as a string.

Tools
GitHub Check: codecov/patch

[warning] 27-27: src/Codebelt.Extensions.Xunit.Hosting/XunitTestLoggerEntry.cs#L27
Added line #L27 was not covered by tests


[warning] 33-33: src/Codebelt.Extensions.Xunit.Hosting/XunitTestLoggerEntry.cs#L33
Added line #L33 was not covered by tests

.nuget/Codebelt.Extensions.Xunit.App/README.md (1)

1-25: LGTM!

The README.md file provides a clear and informative overview of the Codebelt.Extensions.Xunit.App project. It effectively communicates the purpose, scope, and target platforms of the project while also providing helpful links to related packages and their documentation.

The content is well-structured, and the formatting is consistent. Great job on creating a comprehensive and user-friendly README!

test/Codebelt.Extensions.Xunit.Hosting.AspNetCore.Tests/Assets/BoolMiddleware.cs (1)

10-40: LGTM!

The BoolMiddleware class is implemented correctly:

  • It inherits from ConfigurableMiddleware<BoolOptions> to allow for configuration using BoolOptions.
  • The constructors accept either IOptions<BoolOptions> or Action<BoolOptions> for configuration.
  • The InvokeAsync method writes the configured options to the response and calls the next middleware.
.docfx/docfx.json (5)

7-9: LGTM!

The updated source projects align with the PR objective of migrating and rebranding the xUnit extensions. Including the new project files ensures that the documentation is generated for the correct components.


23-23: Verify the impact on the documentation.

Simplifying the xref map by retaining only the link to the cuemon documentation suggests a narrowing of the project's dependencies or a change in the documentation strategy. This can help keep the documentation focused and maintainable.

Please ensure that removing the references to savvyio and sharedkernel does not adversely affect the generated documentation or cross-referencing capabilities.


48-49: LGTM!

Updating the application title and footer in the global metadata aligns with the PR objective of rebranding the project to focus on xUnit extensions by Codebelt. The changes ensure that the generated documentation accurately represents the project's focus and ownership.


52-52: Verify the Google Analytics setup.

Updating the Google Analytics tag ID indicates a potential change in tracking or analytics strategy.

Please ensure that the new tag ID G-S3WBFFNKBL is valid and properly set up in the Google Analytics account to track the documentation site's usage.


56-56: Verify the new GitHub repository.

Updating the GitHub repository link to point to https://github.com/codebeltnet/xuni suggests a shift in project ownership or focus.

Please ensure that the new repository exists and contains the correct source code for the xUnit extensions project. This will help maintain the accuracy and relevance of the generated documentation.

.nuget/Codebelt.Extensions.Xunit/PackageReleaseNotes.txt (6)

1-13: LGTM!

The changes in version 8.4.0 introduce valuable enhancements to the Codebelt.Extensions.Xunit library:

  • The new WriteLines method in the TestOutputHelperExtensions class improves output handling in tests.
  • The ITestOutputHelperAccessor interface and TestOutputHelperAccessor class provide a convenient way to access and utilize the ITestOutputHelper functionality in testing scenarios.

These additions align with the library's goal of enhancing unit testing capabilities for xUnit and ASP.NET Core applications.


14-20: Verify the impact of removing .NET 7 support.

The removal of support for .NET 7 (STS) in version 8.3.2 is a significant change that may impact users who are still using this framework. Please ensure that this decision aligns with the library's roadmap and user base requirements.


21-26: LGTM!

The changes in version 8.3.1 are standard dependency updates and do not introduce any breaking changes or new features.


27-33: LGTM!

The changes in version 8.3.0 introduce useful additions to the Codebelt.Extensions.Xunit library:

  • The new Match method in the Test class provides additional functionality for matching in tests.
  • The WildcardOptions class allows for configuration options for the Match method.

These additions align with the library's goal of enhancing unit testing capabilities for xUnit and ASP.NET Core applications.


34-39: LGTM!

The changes in version 8.2.0 are standard dependency updates and do not introduce any breaking changes or new features.


40-57: LGTM!

The changes in versions 8.1.0, 8.0.1, and 8.0.0 are standard dependency updates and do not introduce any breaking changes or new features.

src/Codebelt.Extensions.Xunit.Hosting.AspNetCore/Http/Features/FakeHttpResponseFeature.cs (1)

9-44: The FakeHttpResponseFeature class is a useful addition for testing HTTP response behavior.

The class provides a clear and well-documented way to trigger the OnStarting callback and track the response state without relying on a full HTTP context. The implementation of the constructor, OnStarting method, and HasStarted property is correct and follows the expected behavior.

Tools
GitHub Check: codecov/patch

[warning] 31-31: src/Codebelt.Extensions.Xunit.Hosting.AspNetCore/Http/Features/FakeHttpResponseFeature.cs#L31
Added line #L31 was not covered by tests


[warning] 33-33: src/Codebelt.Extensions.Xunit.Hosting.AspNetCore/Http/Features/FakeHttpResponseFeature.cs#L33
Added line #L33 was not covered by tests


[warning] 35-35: src/Codebelt.Extensions.Xunit.Hosting.AspNetCore/Http/Features/FakeHttpResponseFeature.cs#L35
Added line #L35 was not covered by tests

.nuget/Codebelt.Extensions.Xunit.Hosting/README.md (1)

1-46: Excellent addition of the README file for the Codebelt.Extensions.Xunit.Hosting package!

The README file is well-structured, informative, and provides a comprehensive overview of the package. It includes:

  • A clear description of the project's license, target platforms, and purpose.
  • An explanation of the Codebelt.Extensions.Xunit.Hosting namespace and its relation to other namespaces.
  • Links to related packages and the documentation site, which are helpful for users to discover additional resources.
  • A C# example demonstrating the usage of AspNetCoreHostTest, which is valuable for users to understand how to use the package effectively.

Overall, this README file serves as an excellent introduction and reference for users interested in using the Codebelt.Extensions.Xunit.Hosting package. Great job!

src/Codebelt.Extensions.Xunit.Hosting/IHostFixture.cs (1)

1-47: LGTM!

The IHostFixture interface provides a well-structured way to integrate Microsoft Dependency Injection within unit tests. It consolidates various testing functionalities into a single contract, making it easier for developers to set up their testing environments.

The delegates enhance the flexibility and configurability of unit tests that rely on hosting and dependency injection. The ConfigureHost method facilitates scenarios where the caller's context is necessary for host configuration.

Overall, the interface is well-designed and enhances the testing capabilities of the library.

src/Codebelt.Extensions.Xunit/WildcardOptions.cs (4)

1-3: LGTM!

The using directives are appropriate for the class implementation.


4-55: LGTM!

The WildcardOptions class is well-designed and properly documented. The properties and constructor provide a clear and flexible way to configure wildcard matching behavior in tests.


33-34: LGTM!

The default values for GroupOfCharacters and SingleCharacter properties are appropriately escaped to handle the special characters.


56-56: LGTM!

The namespace is correctly closed.

src/Codebelt.Extensions.Xunit/TestOutputHelperExtensions.cs (3)

22-26: LGTM!

The extension method is well-implemented with clear documentation, null validation, and efficient string formatting using DelimitedString. The code is clean and follows best practices.


36-39: LGTM!

This overload provides a convenient way to pass an array to the WriteLines method. Delegating to the IEnumerable<T> overload is a good design choice to avoid code duplication. The code is clean and follows best practices.


49-53: LGTM!

The generic extension method is well-implemented with clear documentation, null validation, and efficient string formatting using DelimitedString. The code is clean and follows best practices.

.nuget/Codebelt.Extensions.Xunit.Hosting/PackageReleaseNotes.txt (7)

1-10: LGTM!

The release notes for version 8.4.0 include several positive changes:

  • Availability for multiple .NET versions ensures compatibility with a wide range of projects.
  • Updating dependencies to the latest versions maintains security and performance.
  • The new extension methods in the ServiceProviderExtensions and ServiceCollectionExtensions classes enhance the functionality of the package for service retrieval and integration with Xunit test output helpers.

Great work on these improvements!


11-16: Verify the impact of removing .NET 7 support.

The release notes for version 8.3.2 mention the removal of support for .NET 7. This change may impact projects targeting that version.

Please ensure that the removal of .NET 7 support does not adversely affect any existing projects or users of the package. Consider providing a migration guide or documentation to assist users in transitioning to supported .NET versions if necessary.


18-22: LGTM!

The release notes for version 8.3.1 mention updating dependencies to the latest versions, which is a good practice to maintain security and performance.


24-28: LGTM!

The release notes for version 8.2.0 mention updating dependencies to the latest versions, which is a good practice to maintain security and performance.


30-40: LGTM!

The release notes for version 8.1.0 include several positive changes:

  • Updating dependencies to the latest versions maintains security and performance.
  • The new extension methods in the LoggerExtensions and ServiceCollectionExtensions classes enhance the functionality of the package for logging and service registration in the context of Xunit testing.
  • The XunitTestLoggerEntry record provides a convenient way to capture and inspect log entries during testing.

These additions will be valuable for developers using the package for testing purposes.


41-45: LGTM!

The release notes for version 8.0.1 mention updating dependencies to the latest versions, which is a good practice to maintain security and performance.


47-57: Verify the impact of the breaking change.

The release notes for version 8.0.0 mention a breaking change: the removal of the CreateGenericHostTest method from the GenericHostTestFactory class. This change may impact existing code that relies on this method.

Please ensure that the removal of the CreateGenericHostTest method does not adversely affect any existing projects or users of the package. Consider providing a migration guide or documentation to assist users in updating their code to handle this change.

Bug fix looks good!

The bug fix in the HostFixture class, which adds a null conditional operator to the ServiceProvider property, addresses a potential null reference exception issue. This is a positive change that improves the stability of the package.

src/Codebelt.Extensions.Xunit.Hosting/Codebelt.Extensions.Xunit.Hosting.csproj (6)

1-2: LGTM!

The project SDK is correctly set to "Microsoft.NET.Sdk" for a .NET project.


3-11: LGTM!

The property groups are correctly defined, including the project GUID, SonarQube test project setting, description, and relevant package tags.


13-19: LGTM!

The conditional item group for the .NET 8 target framework includes relevant package references with appropriate versions.


21-27: LGTM!

The conditional item group for the .NET 6 target framework includes relevant package references with appropriate versions.


29-35: LGTM!

The conditional item group for the .NET Standard 2 target framework includes relevant package references with appropriate versions.


37-43: LGTM!

The package reference to "xunit.extensibility.core" and the project reference to "Codebelt.Extensions.Xunit" are correctly defined and relevant to the project's functionality.

src/Codebelt.Extensions.Xunit/InMemoryTestStore.cs (2)

13-22: LGTM!

The InMemoryTestStore<T> class correctly implements the ITestStore<T> interface and uses a private List<T> to store the items in memory. The parameterless constructor is empty, which is fine since no initialization is required.


40-43: LGTM!

The Add method correctly adds the item to the private _store field.

src/Codebelt.Extensions.Xunit.Hosting.AspNetCore/AspNetCoreHostTest.cs (4)

1-14: LGTM!

The using statements, namespace, and class declaration are all appropriate and follow the standard conventions.


16-24: LGTM!

The constructor parameters and the call to the base class constructor are appropriate. The empty constructor body is acceptable since the initialization logic is likely handled in the base class.


26-44: LGTM!

The InitializeHostFixture method provides a solid default implementation for initializing the host fixture. The logic for handling an invalid state and setting up the configuration callbacks is well-structured. Assigning the properties based on the host fixture ensures that the test class has access to the necessary dependencies.


46-57: LGTM!

The Application property and the abstract ConfigureApplication method are well-designed. The property provides access to the IApplicationBuilder instance, and the protected setter allows flexibility for derived classes. The abstract method enforces derived classes to configure the HTTP request pipeline, promoting a modular and extensible approach.

test/Codebelt.Extensions.Xunit.Hosting.AspNetCore.Tests/WebHostTestFactoryTest.cs (4)

8-12: LGTM!

The WebHostTestFactoryTest class is properly defined as a public class inheriting from the Test base class. The constructor correctly takes an ITestOutputHelper parameter for capturing test output.


14-29: LGTM!

The CreateMiddlewareTest_CallerTypeShouldHaveDeclaringTypeOfMiddlewareTestFactoryTest method is a well-defined unit test that verifies the behavior of the WebHostTestFactory.Create method. The test logic is clear and focused, and the assertions cover the expected behavior of the middleware and hosting environment.


31-42: LGTM!

The RunMiddlewareTest_ShouldHaveApplicationNameEqualToThisAssembly method is a well-defined asynchronous unit test that verifies the behavior of the WebHostTestFactory.RunAsync method. The test logic is clear and focused, and the assertion covers the expected behavior of the hosting environment.


44-71: LGTM!

The RunMiddlewareTest_ShouldHaveApplicationNameEqualToThisAssembly_WithHostBuilderContext method is a well-defined asynchronous unit test that verifies the behavior of the WebHostTestFactory.RunWithHostBuilderContextAsync method. The test logic is clear and focused, and the assertions cover the expected behavior of the host builder context and hosting environment.

test/Codebelt.Extensions.Xunit.Hosting.AspNetCore.Tests/AspNetCoreHostTestTest.cs (4)

21-26: LGTM!

The constructor is properly initializing the required dependencies.


28-47: LGTM!

The test method is correctly validating the behavior of the BoolMiddleware. The assertions are checking the response body and the BoolOptions values as expected.


56-60: LGTM!

The ConfigureApplication method is correctly configuring the application pipeline by adding the BoolMiddleware. The logging statement is helpful for debugging purposes.


62-73: LGTM!

The ConfigureServices method is correctly configuring the required services for the test scenario. The use of FakeHttpContextAccessor, BoolOptions configuration, and the addition of ITestOutputHelperAccessor and XunitTestLogging services are all appropriate for the testing context.

src/Codebelt.Extensions.Xunit.Hosting/GenericHostTest.cs (1)

1-68: The GenericHostTest class implementation looks good overall.

The class provides a structured way to set up and configure a generic host for testing purposes, enhancing the flexibility and reusability of host configurations in unit tests.

Tools
GitHub Check: codecov/patch

[warning] 16-18: src/Codebelt.Extensions.Xunit.Hosting/GenericHostTest.cs#L16-L18
Added lines #L16 - L18 were not covered by tests


[warning] 20-29: src/Codebelt.Extensions.Xunit.Hosting/GenericHostTest.cs#L20-L29
Added lines #L20 - L29 were not covered by tests


[warning] 32-34: src/Codebelt.Extensions.Xunit.Hosting/GenericHostTest.cs#L32-L34
Added lines #L32 - L34 were not covered by tests


[warning] 36-45: src/Codebelt.Extensions.Xunit.Hosting/GenericHostTest.cs#L36-L45
Added lines #L36 - L45 were not covered by tests


[warning] 48-49: src/Codebelt.Extensions.Xunit.Hosting/GenericHostTest.cs#L48-L49
Added lines #L48 - L49 were not covered by tests


[warning] 52-53: src/Codebelt.Extensions.Xunit.Hosting/GenericHostTest.cs#L52-L53
Added lines #L52 - L53 were not covered by tests


[warning] 55-55: src/Codebelt.Extensions.Xunit.Hosting/GenericHostTest.cs#L55
Added line #L55 was not covered by tests


[warning] 58-58: src/Codebelt.Extensions.Xunit.Hosting/GenericHostTest.cs#L58
Added line #L58 was not covered by tests


[warning] 61-66: src/Codebelt.Extensions.Xunit.Hosting/GenericHostTest.cs#L61-L66
Added lines #L61 - L66 were not covered by tests

GitHub Check: 🔬 Code Quality Analysis

[warning] 47-47:
Add a nested comment explaining why this method is empty, throw a 'NotSupportedException' or complete the implementation. (https://rules.sonarsource.com/csharp/RSPEC-1186)


[warning] 47-47:
Add a nested comment explaining why this method is empty, throw a 'NotSupportedException' or complete the implementation. (https://rules.sonarsource.com/csharp/RSPEC-1186)


[warning] 47-47:
Add a nested comment explaining why this method is empty, throw a 'NotSupportedException' or complete the implementation. (https://rules.sonarsource.com/csharp/RSPEC-1186)

.nuget/Codebelt.Extensions.Xunit.Hosting.AspNetCore/PackageReleaseNotes.txt (4)

4-5: LGTM!

Updating dependencies to the latest versions is a good practice to ensure compatibility and access to the latest features and bug fixes.


13-14: LGTM!

Updating the AspNetCoreHostFixture class to use the same host builder validation as introduced with the forthcoming .NET 9 is a good improvement that aligns the class with the latest standards and practices.


16-17: LGTM!

Adding the HttpClientExtensions class with the ToHttpResponseMessageAsync extension method for the HttpClient class is a useful new feature that facilitates easier handling of HTTP responses in tests.


7-11: Verify the impact of the breaking changes on the codebase.

The removal of the IMiddlewareTest interface and MiddlewareTestFactory static class, as well as the renaming of the Run and RunWithHostBuilderContext methods to RunAsync and RunWithHostBuilderContextAsync, respectively, are breaking changes that may affect existing code.

Please ensure that all code that depends on these types and methods has been updated accordingly.

Run the following script to verify the usage of the removed and renamed types and methods:

Verification successful

Update test file to reflect breaking changes

The breaking changes have been successfully implemented in the codebase. The RunAsync and RunWithHostBuilderContextAsync methods are present and being used correctly. The old method names and the IMiddlewareTest interface have been removed as intended.

However, please update the following test file to reflect these breaking changes:

  • test/Codebelt.Extensions.Xunit.Hosting.AspNetCore.Tests/WebHostTestFactoryTest.cs
    • Review and update or remove the test method CreateMiddlewareTest_CallerTypeShouldHaveDeclaringTypeOfMiddlewareTestFactoryTest() as it references the removed MiddlewareTestFactory.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of the removed and renamed types and methods.

# Test: Search for the usage of the removed `IMiddlewareTest` interface. Expect: No occurrences.
rg --type cs $'IMiddlewareTest'

# Test: Search for the usage of the removed `MiddlewareTestFactory` static class. Expect: No occurrences.
rg --type cs $'MiddlewareTestFactory'

# Test: Search for the usage of the renamed `Run` method. Expect: No occurrences.
rg --type cs $'Run\(' --case-sensitive

# Test: Search for the usage of the renamed `RunWithHostBuilderContext` method. Expect: No occurrences.
rg --type cs $'RunWithHostBuilderContext\(' --case-sensitive

Length of output: 624


Script:

#!/bin/bash
# Description: Further investigate the breaking changes and verify the new method names.

# Test: Check the context of the MiddlewareTestFactory occurrence
rg --type cs -C 5 'MiddlewareTestFactory'

# Test: Search for the usage of the new RunAsync method
rg --type cs 'RunAsync\(' --case-sensitive

# Test: Search for the usage of the new RunWithHostBuilderContextAsync method
rg --type cs 'RunWithHostBuilderContextAsync\(' --case-sensitive

# Test: Check the WebHostTestFactory class for the new method names
ast-grep --lang csharp --pattern 'class WebHostTestFactory {
  $$$
  RunAsync($$$) {
    $$$
  }
  $$$
  RunWithHostBuilderContextAsync($$$) {
    $$$
  }
  $$$
}'

Length of output: 3066

src/Codebelt.Extensions.Xunit.Hosting/ServiceCollectionExtensions.cs (3)

26-36: LGTM!

The method implementation looks good. It validates the input parameters, configures the logging with the provided settings, and returns the updated services collection for chaining.


43-47: LGTM!

The method implementation looks good. It provides a convenient way to add the default ITestOutputHelperAccessor implementation to the services collection and returns the updated services collection for chaining.

Tools
GitHub Check: codecov/patch

[warning] 44-47: src/Codebelt.Extensions.Xunit.Hosting/ServiceCollectionExtensions.cs#L44-L47
Added lines #L44 - L47 were not covered by tests


58-63: LGTM!

The method implementation looks good. It provides a way to add a custom ITestOutputHelperAccessor implementation to the services collection, validates the input parameter, and returns the updated services collection for chaining.

Tools
GitHub Check: codecov/patch

[warning] 59-63: src/Codebelt.Extensions.Xunit.Hosting/ServiceCollectionExtensions.cs#L59-L63
Added lines #L59 - L63 were not covered by tests

Directory.Build.props (13)

5-7: LGTM!

The introduction of IsLinux and IsWindows properties allows for platform-specific configurations, which can be beneficial for multi-platform projects. The updated email address for IsMainAuthor reflects the change in authorship.


18-18: LGTM!

The expansion of the TargetFrameworks property to include net8.0, net6.0, and netstandard2.0 enhances the project's compatibility and support for different .NET versions, which aligns with the goal of improving functionality across various environments.


19-22: LGTM!

The updated copyright, author, company, and product information reflect the project's rebranding and alignment with the new organization, "Geekle," and the product name, "Extensions for xUnit API by Codebelt." These changes are consistent with the project's migration and rebranding objectives.


25-25: LGTM!

The updated PackageProjectUrl pointing to https://www.codebelt.net/ reflects the project's new online presence and aligns with the rebranding efforts.


27-27: LGTM!

The updated RepositoryUrl pointing to https://github.com/codebeltnet/xunit reflects the project's new repository location and aligns with the migration efforts.


36-36: LGTM!

The updated AssemblyOriginatorKeyFile referencing $(MSBuildThisFileDirectory)xunit.snk aligns with the project's new identity and rebranding efforts.


41-41: Verify the RepositoryUrl in the SourceRoot element.

The updated RepositoryUrl in the SourceRoot element points to https://github.com/codebeltnet/xuni, which seems to be inconsistent with the RepositoryUrl updated earlier in the file (https://github.com/codebeltnet/xunit). Please verify if this is intentional or if it needs to be updated to maintain consistency.


46-46: LGTM!

The upgrade of the MinVer package to version 6.0.0 ensures that the project is using the latest version of the versioning tool, which can provide bug fixes, performance improvements, and new features.


51-53: LGTM!

The addition of the new property group to specify the target frameworks (net8.0 and net6.0) for test projects on Linux allows for platform-specific configurations and ensures that the tests are run on the appropriate .NET versions for that platform.


55-57: LGTM!

The addition of the new property group to specify the target frameworks (net8.0, net6.0, and net48) for test projects on Windows allows for platform-specific configurations and ensures that the tests are run on the appropriate .NET versions for that platform, including the .NET Framework 4.8.


67-67: LGTM!

The expansion of the NoWarn property to include additional warnings (NU1701, NU1903, and NETSDK1206) for test projects helps suppress specific NuGet and .NET SDK warnings, reducing noise in the build output and allowing focus on more critical issues.


72-75: LGTM!

Updating the test-related packages (Microsoft.NET.Test.Sdk, xunit, xunit.runner.console, and xunit.runner.visualstudio) to their latest versions ensures that the project is using the most recent features, bug fixes, and performance improvements. The updated versions of xunit and its related packages enhance the project's testing capabilities and align with the latest xUnit framework.


86-88: LGTM!

The addition of the project reference to ..\..\src\Codebelt.Extensions.Xunit\Codebelt.Extensions.Xunit.csproj for test projects ensures that the test projects have access to the necessary extensions and utilities provided by the Codebelt.Extensions.Xunit project. This allows the test projects to utilize the functionality provided by the referenced project.

src/Codebelt.Extensions.Xunit/Test.cs (1)

1-80: LGTM!

The Test class provides a solid foundation for implementing unit tests by extending Disposable and implementing ITest. It offers useful functionality such as:

  • Wildcard-based string matching with the Match method, which can be handy for comparing expected and actual values in tests.
  • Initialization of the TestOutput property in the constructor, which is crucial for outputting test information in xUnit projects.
  • Capturing the type of the caller, defaulting to the type of the current instance if not provided.

The class is well-structured and enhances the testing framework by providing utilities for string matching and structured output handling, making it easier to implement and manage unit tests.

src/Codebelt.Extensions.Xunit.Hosting.AspNetCore/WebHostTest.cs (1)

9-88: LGTM! The WebHostTest class enhances the testing capabilities for ASP.NET Core applications.

The WebHostTest class provides a flexible and structured way to configure and initialize the host, application, and services for testing ASP.NET Core applications. The key benefits include:

  • Constructors that accept delegates for configuration, allowing for dynamic adjustments to the test environment.
  • Overridden methods that apply the provided configurations consistently.
  • Support for both standard and context-aware configurations.
  • Addition of a singleton FakeHttpContextAccessor to the service collection, which can be useful for simulating HTTP context in tests.

Overall, this class facilitates more robust and flexible unit testing scenarios for ASP.NET Core applications.

Tools
GitHub Check: 🔬 Code Quality Analysis

[warning] 56-56:
Add a nested comment explaining why this method is empty, throw a 'NotSupportedException' or complete the implementation. (https://rules.sonarsource.com/csharp/RSPEC-1186)


[warning] 56-56:
Add a nested comment explaining why this method is empty, throw a 'NotSupportedException' or complete the implementation. (https://rules.sonarsource.com/csharp/RSPEC-1186)

src/Codebelt.Extensions.Xunit.Hosting.AspNetCore/WebHostTestFactory.cs (4)

24-27: LGTM!

The Create method is well-documented and implemented correctly. It provides a clean way to create an IWebHostTest instance with optional configuration actions for services, middleware pipeline, and host builder.


36-39: LGTM!

The CreateWithHostBuilderContext method is well-documented and implemented correctly. It provides a clean way to create an IWebHostTest instance with optional configuration actions for services, middleware pipeline, and host builder, while also providing access to the HostBuilderContext.


49-53: LGTM!

The RunAsync method is well-documented and implemented correctly. It provides a convenient way to run a middleware and retrieve an HttpClient for making HTTP requests to the test server. The method properly disposes of the HttpClient and returns the HttpResponseMessage asynchronously.


63-67: LGTM!

The RunWithHostBuilderContextAsync method is well-documented and implemented correctly. It provides a convenient way to run a filter/middleware test and retrieve an HttpResponseMessage. The method properly disposes of the HttpClient and returns the HttpResponseMessage asynchronously, while also providing access to the HostBuilderContext for configuration actions.

src/Codebelt.Extensions.Xunit.Hosting.AspNetCore/AspNetCoreHostFixture.cs (1)

20-108: LGTM!

The AspNetCoreHostFixture class provides a well-structured and extensible implementation for configuring an ASP.NET Core host in a testing environment. The class follows the Single Responsibility Principle and encapsulates the host configuration logic effectively.

Some key observations:

  • The class constructor is empty, which is appropriate as no specific initialization is required.
  • The ConfigureHost method is the core of the class, responsible for setting up the host configuration using the HostBuilder. It validates the input parameter and configures various aspects of the host, such as the content root, environment, application configuration, logging, and services.
  • The ConfigureApplicationCallback property allows for custom configuration of the application pipeline, providing flexibility for different test scenarios.
  • The Application property exposes the configured IApplicationBuilder for further use, enabling additional customization and assertions in tests.

Overall, the class is well-designed and provides a solid foundation for configuring an ASP.NET Core host in a testing environment.

CHANGELOG.md (8)

12-18: The additions in version 8.4.0 look good!

The new classes and interfaces added in the Codebelt.Extensions.Xunit namespaces enhance the library's functionality and provide more options for unit testing. The additions are well-documented and follow a consistent naming convention.


26-30: The removals in version 8.4.0 are justified.

The removal of the Codebelt.Extensions.Xunit.Hosting.AspNetCore.Mvc project and associated interfaces helps streamline the library's structure by consolidating functionality. While these are breaking changes, the changelog provides clear guidance on the alternatives to use, such as the IWebHostTest interface and WebHostTestFactory class in the Codebelt.Extensions.Xunit.Hosting.AspNetCore namespace.


41-43: The removal of TFM net7.0 is justified.

The removal of TFM net7.0 for all projects due to its end-of-life status is a necessary change to ensure the library remains up-to-date and secure. The changelog provides a clear explanation for this removal, linking to the end-of-life date for .NET 7.0.


54-57: The additions in version 8.3.1 are well-documented.

The new IWebHostTest interface and WebHostTestFactory class in the Codebelt.Extensions.Xunit.Hosting.AspNetCore namespace provide a consolidated approach for ASP.NET Core testing. The changelog clearly describes the purpose of these additions and their intended use.


59-64: The deprecations in version 8.3.1 are handled appropriately.

The deprecation of the IMiddlewareTest interface, MiddlewareTestFactory class, IWebApplicationTest interface, and WebApplicationTestFactory class in favor of the new consolidated IWebHostTest interface and WebHostTestFactory class is a good decision to streamline the library's API. The changelog provides clear guidance on the alternatives to use, ensuring a smooth migration path for users.


73-79: The additions in version 8.1.0 enhance testing capabilities.

The new LoggerExtensions class, ServiceCollectionExtensions class, and TestLoggerEntry record in the Codebelt.Extensions.Xunit.Hosting namespace provide additional functionality for testing purposes, such as capturing log entries and adding test logging to the service collection. These additions are valuable for improving the library's testing capabilities.


81-90: The changes and fix in version 8.0.0 improve the library's quality.

The extension of unit tests to include multiple target frameworks (TFM net8.0, net7.0, net6.0, and net48 for Windows) ensures better coverage and compatibility across different .NET versions. The inclusion of Microsoft.TestPlatform.ObjectModel for xUnit when testing on legacy .NET Framework demonstrates attention to detail and backward compatibility.

The fix for the ServiceProvider property on the HostFixture class, adding a null conditional operator, improves the library's reliability and prevents potential null reference exceptions.


20-24: Verify the impact of the breaking changes in version 8.4.0.

The changes in version 8.4.0, particularly the renaming of methods in the WebHostTestFactory class, are breaking changes. While the renaming aligns with asynchronous programming practices, it's important to ensure that these changes don't break existing code that depends on the previous method names.

Verification successful

Breaking changes in version 8.4.0 have been correctly implemented

The renaming of methods in the WebHostTestFactory class, as mentioned in the CHANGELOG.md, has been verified:

  • Run() has been renamed to RunAsync()
  • RunWithHostBuilderContext() has been renamed to RunWithHostBuilderContextAsync()

These changes are consistent across the codebase:

  • The new method names are defined in src/Codebelt.Extensions.Xunit.Hosting.AspNetCore/WebHostTestFactory.cs
  • The new methods are being used in tests (test/Codebelt.Extensions.Xunit.Hosting.AspNetCore.Tests/WebHostTestFactoryTest.cs)
  • No occurrences of the old method names were found in the WebHostTestFactory class

The breaking changes have been implemented correctly, and the codebase appears to be consistent with these changes.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of the renamed methods in the codebase.

# Test: Search for the old method names. Expect: No occurrences.
rg --type cs $'Run\(' 
rg --type cs $'RunWithHostBuilderContext\('

Length of output: 335


Script:

#!/bin/bash
# Description: Verify the usage of the new method names and WebHostTestFactory class

# Search for the new method names
echo "Searching for RunAsync:"
rg --type cs 'RunAsync\('

echo "Searching for RunWithHostBuilderContextAsync:"
rg --type cs 'RunWithHostBuilderContextAsync\('

# Search for WebHostTestFactory class
echo "Searching for WebHostTestFactory class:"
rg --type cs 'class WebHostTestFactory'

# Double-check for any remaining old method names in WebHostTestFactory
echo "Checking for old method names in WebHostTestFactory:"
rg --type cs -C 5 'class WebHostTestFactory' | rg 'Run\(|RunWithHostBuilderContext\('

Length of output: 1896

.github/workflows/pipelines.yml (7)

1-1: LGTM!

The pipeline name change accurately reflects the focus on xUnit extensions.


3-11: LGTM!

The trigger change to pull_request events and the addition of the paths-ignore configuration are appropriate optimizations for the pipeline.


25-29: LGTM!

The addition of the matrix strategy for multiple configurations and frameworks, along with the timeout-minutes property, enhances the flexibility and efficiency of the build process.


34-66: LGTM!

The updates to use versioned actions, the adjusted download step for the signing key, and the new step for setting environment variables based on the framework are all appropriate improvements to the build process.

Tools
actionlint

56-56: shellcheck reported issue in this script: SC2086:info:6:56: Double quote to prevent globbing and word splitting

(shellcheck)


56-56: shellcheck reported issue in this script: SC2086:info:8:38: Double quote to prevent globbing and word splitting

(shellcheck)


69-76: LGTM!

The updates to use versioned actions for restoring dependencies and building the project, along with the added projects and framework properties to support the matrix strategy, are appropriate improvements to the build process.


Line range hint 81-124: LGTM!

The updates to the pack and test jobs, including the matrix strategy for multiple configurations and operating systems, the use of versioned actions, and the addition of the timeout-minutes property, are appropriate improvements to enhance flexibility, efficiency, and stability.


131-219: LGTM!

The addition of the sonarcloud, codecov, and codeql jobs for code quality, coverage, and security analysis, along with the use of versioned actions and the timeout-minutes property, is a significant enhancement to the overall quality and security of the codebase. The updated condition in the deploy job to prevent execution on pull requests is also an appropriate safeguard.

src/Codebelt.Extensions.Xunit.Hosting/HostTest.cs (1)

18-131: LGTM!

The HostTest<T> class is well-structured and provides a solid foundation for unit testing implementations that utilize Microsoft Dependency Injection. The class exposes convenient properties for accessing initialized dependencies, and the Configure, ConfigureHost, and ConfigureServices methods allow for proper customization and dependency management.

Tools
GitHub Check: 🔬 Code Quality Analysis

[warning] 29-29:
Remove this call from a constructor to the overridable 'InitializeHostFixture' method. (https://rules.sonarsource.com/csharp/RSPEC-1699)


[warning] 29-29:
Remove this call from a constructor to the overridable 'InitializeHostFixture' method. (https://rules.sonarsource.com/csharp/RSPEC-1699)

src/Codebelt.Extensions.Xunit.Hosting/HostFixture.cs (1)

1-140: LGTM!

The HostFixture class provides a well-structured and extensible way to configure and manage a host environment for unit testing in .NET applications. The class follows the SOLID principles and encapsulates the complexity of setting up a host environment, making it easier for developers to write and maintain unit tests.

Some additional suggestions for improvement:

  1. Consider adding more XML documentation comments to the class and its members to provide more detailed information about their purpose and usage.
  2. Consider adding more unit tests to cover different scenarios and edge cases.
  3. Consider adding more extension points to the class to allow for more customization and flexibility.

Comment on lines +30 to +32
public void Dispose()
{
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add test coverage for the Dispose method or remove it if not needed.

The static analysis tool indicates that the Dispose method at lines 30-32 is not covered by tests. Consider the following:

  • If the Dispose method is required to release unmanaged resources, add a test to ensure it behaves as expected.
  • If the Dispose method is not needed, remove it to avoid confusion and maintain a clean codebase.
Tools
GitHub Check: codecov/patch

[warning] 31-32: src/Codebelt.Extensions.Xunit.Hosting/XunitTestLoggerProvider.cs#L31-L32
Added lines #L31 - L32 were not covered by tests

Comment on lines +44 to +47
}
}
}
throw new ArgumentException($"Logger does not contain a test store; did you remember to call {nameof(ServiceCollectionExtensions.AddXunitTestLogging)} before calling this method?", nameof(logger));
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add tests to cover the scenario where the logger does not contain a test store.

The static analysis hints indicate that lines 44-47 are not covered by tests. This could potentially lead to undetected bugs if the logger does not contain a test store.

Do you want me to generate the unit testing code or open a GitHub issue to track this task?

Tools
GitHub Check: codecov/patch

[warning] 44-47: src/Codebelt.Extensions.Xunit.Hosting/LoggerExtensions.cs#L44-L47
Added lines #L44 - L47 were not covered by tests

Comment on lines +49 to +54
[Fact]
public void ShouldLogToXunitTestLogging()
{
var logger = _pipeline.ApplicationServices.GetRequiredService<ILogger<AspNetCoreHostTestTest>>();
logger.LogInformation("Hello from {0}", nameof(ShouldLogToXunitTestLogging));
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add assertions to validate the logging behavior.

The test method is logging a message using the ILogger<AspNetCoreHostTestTest> instance, but there are no assertions to validate that the message is being captured by the Xunit test logging infrastructure.

Consider adding assertions to check the test output or the Xunit test logging sink to ensure that the logged message is present. For example:

// Example assertion
var testOutput = _provider.GetRequiredService<ITestOutputHelperAccessor>().TestOutput;
Assert.Contains("Hello from ShouldLogToXunitTestLogging", testOutput.Output);

Comment on lines 1 to 68
using System;
using Cuemon;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;

namespace Codebelt.Extensions.Xunit.Hosting
{
internal sealed class GenericHostTest : HostTest<HostFixture>, IGenericHostTest
{
private readonly Action<IServiceCollection> _serviceConfigurator;
private readonly Action<HostBuilderContext, IServiceCollection> _serviceConfiguratorWithContext;
private readonly Action<IHostBuilder> _hostConfigurator;
private HostBuilderContext _hostBuilderContext;

internal GenericHostTest(Action<IServiceCollection> serviceConfigurator, Action<IHostBuilder> hostConfigurator, HostFixture hostFixture) : base(hostFixture, callerType: serviceConfigurator?.Target?.GetType() ?? hostConfigurator?.Target?.GetType())
{
_serviceConfigurator = serviceConfigurator;
_hostConfigurator = hostConfigurator;
if (!hostFixture.HasValidState())
{
hostFixture.ConfigureHostCallback = ConfigureHost;
hostFixture.ConfigureCallback = Configure;
hostFixture.ConfigureServicesCallback = ConfigureServices;
hostFixture.ConfigureHost(this);
}
Host = hostFixture.Host;
ServiceProvider = hostFixture.Host.Services;
Configure(hostFixture.Configuration, hostFixture.HostingEnvironment);
}

internal GenericHostTest(Action<HostBuilderContext, IServiceCollection> serviceConfigurator, Action<IHostBuilder> hostConfigurator, HostFixture hostFixture) : base(hostFixture, callerType: serviceConfigurator?.Target?.GetType() ?? hostConfigurator?.Target?.GetType())
{
_serviceConfiguratorWithContext = serviceConfigurator;
_hostConfigurator = hostConfigurator;
if (!hostFixture.HasValidState())
{
hostFixture.ConfigureHostCallback = ConfigureHost;
hostFixture.ConfigureCallback = Configure;
hostFixture.ConfigureServicesCallback = ConfigureServices;
hostFixture.ConfigureHost(this);
}
Host = hostFixture.Host;
ServiceProvider = hostFixture.Host.Services;
Configure(hostFixture.Configuration, hostFixture.HostingEnvironment);
}

protected override void InitializeHostFixture(HostFixture hostFixture)
{
}

protected override void ConfigureHost(IHostBuilder hb)
{
_hostBuilderContext = new HostBuilderContext(hb.Properties);
_hostConfigurator?.Invoke(hb);
}

public override void ConfigureServices(IServiceCollection services)
{
_serviceConfigurator?.Invoke(services);
_serviceConfiguratorWithContext?.Invoke(Tweaker.Adjust(_hostBuilderContext, hbc =>
{
hbc.Configuration = Configuration;
hbc.HostingEnvironment = HostingEnvironment;
return hbc;
}), services);
}
}
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Improve test coverage for the GenericHostTest class.

The static analysis hints indicate that several lines, especially in the constructors and configuration methods, are not covered by tests. To ensure the reliability and maintainability of the code, it's important to have adequate test coverage.

Do you want me to generate the missing unit tests or open a GitHub issue to track this task?

Tools
GitHub Check: codecov/patch

[warning] 16-18: src/Codebelt.Extensions.Xunit.Hosting/GenericHostTest.cs#L16-L18
Added lines #L16 - L18 were not covered by tests


[warning] 20-29: src/Codebelt.Extensions.Xunit.Hosting/GenericHostTest.cs#L20-L29
Added lines #L20 - L29 were not covered by tests


[warning] 32-34: src/Codebelt.Extensions.Xunit.Hosting/GenericHostTest.cs#L32-L34
Added lines #L32 - L34 were not covered by tests


[warning] 36-45: src/Codebelt.Extensions.Xunit.Hosting/GenericHostTest.cs#L36-L45
Added lines #L36 - L45 were not covered by tests


[warning] 48-49: src/Codebelt.Extensions.Xunit.Hosting/GenericHostTest.cs#L48-L49
Added lines #L48 - L49 were not covered by tests


[warning] 52-53: src/Codebelt.Extensions.Xunit.Hosting/GenericHostTest.cs#L52-L53
Added lines #L52 - L53 were not covered by tests


[warning] 55-55: src/Codebelt.Extensions.Xunit.Hosting/GenericHostTest.cs#L55
Added line #L55 was not covered by tests


[warning] 58-58: src/Codebelt.Extensions.Xunit.Hosting/GenericHostTest.cs#L58
Added line #L58 was not covered by tests


[warning] 61-66: src/Codebelt.Extensions.Xunit.Hosting/GenericHostTest.cs#L61-L66
Added lines #L61 - L66 were not covered by tests

GitHub Check: 🔬 Code Quality Analysis

[warning] 47-47:
Add a nested comment explaining why this method is empty, throw a 'NotSupportedException' or complete the implementation. (https://rules.sonarsource.com/csharp/RSPEC-1186)


[warning] 47-47:
Add a nested comment explaining why this method is empty, throw a 'NotSupportedException' or complete the implementation. (https://rules.sonarsource.com/csharp/RSPEC-1186)


[warning] 47-47:
Add a nested comment explaining why this method is empty, throw a 'NotSupportedException' or complete the implementation. (https://rules.sonarsource.com/csharp/RSPEC-1186)

Comment on lines 56 to 58
protected override void InitializeHostFixture(AspNetCoreHostFixture hostFixture)
{
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Address the empty InitializeHostFixture method.

The static analysis tool has correctly identified that the InitializeHostFixture method is empty. Please consider one of the following actions:

  • If the method is not required, remove it to avoid confusion and improve code clarity.
  • If the method is intentionally left empty, add a comment explaining the reason for the empty implementation. For example:
protected override void InitializeHostFixture(AspNetCoreHostFixture hostFixture)
{
    // Intentionally left empty as no additional initialization is required for the host fixture.
}
Tools
GitHub Check: 🔬 Code Quality Analysis

[warning] 56-56:
Add a nested comment explaining why this method is empty, throw a 'NotSupportedException' or complete the implementation. (https://rules.sonarsource.com/csharp/RSPEC-1186)


[warning] 56-56:
Add a nested comment explaining why this method is empty, throw a 'NotSupportedException' or complete the implementation. (https://rules.sonarsource.com/csharp/RSPEC-1186)

protected HostTest(T hostFixture, ITestOutputHelper output = null, Type callerType = null) : base(output, callerType)
{
Validator.ThrowIfNull(hostFixture);
InitializeHostFixture(hostFixture);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider moving the InitializeHostFixture call out of the constructor.

The static analysis tool has flagged a warning about calling the overridable InitializeHostFixture method from the constructor. This could lead to unexpected behavior if the method is overridden in derived classes.

To address this, consider moving the InitializeHostFixture call out of the constructor and into a separate non-virtual method that is called explicitly by derived classes. For example:

-   protected HostTest(T hostFixture, ITestOutputHelper output = null, Type callerType = null) : base(output, callerType)
-   {
-       Validator.ThrowIfNull(hostFixture);
-       InitializeHostFixture(hostFixture);
-   }
+   protected HostTest(T hostFixture, ITestOutputHelper output = null, Type callerType = null) : base(output, callerType)
+   {
+       Validator.ThrowIfNull(hostFixture);
+   }
+
+   protected void SetUpHostFixture(T hostFixture)
+   {
+       InitializeHostFixture(hostFixture);
+   }

Then, in derived classes, explicitly call the SetUpHostFixture method after the constructor:

public class MyTest : HostTest<MyHostFixture>
{
    public MyTest(MyHostFixture hostFixture) : base(hostFixture)
    {
        SetUpHostFixture(hostFixture);
    }

    // ...
}

This way, the InitializeHostFixture method is not called from the constructor, and derived classes have control over when to initialize the host fixture.

Tools
GitHub Check: 🔬 Code Quality Analysis

[warning] 29-29:
Remove this call from a constructor to the overridable 'InitializeHostFixture' method. (https://rules.sonarsource.com/csharp/RSPEC-1699)


[warning] 29-29:
Remove this call from a constructor to the overridable 'InitializeHostFixture' method. (https://rules.sonarsource.com/csharp/RSPEC-1699)

@sonarqubecloud
Copy link

@gimlichael gimlichael merged commit 270b1c9 into main Sep 15, 2024
@gimlichael gimlichael deleted the v8.4.0/migrate-from-cuemon branch September 15, 2024 21:24
This was referenced Sep 23, 2024
@coderabbitai coderabbitai bot mentioned this pull request Nov 11, 2024
@coderabbitai coderabbitai bot mentioned this pull request Jan 24, 2025
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