Skip to content

Use Combinatorial.MSTest for boolean DataRow tests in Microsoft.NET.Pack.Tests - #55018

Draft
Evangelink wants to merge 1 commit into
dotnet:mainfrom
Evangelink:dev/amauryleve/combinatorial-pack-tests
Draft

Use Combinatorial.MSTest for boolean DataRow tests in Microsoft.NET.Pack.Tests#55018
Evangelink wants to merge 1 commit into
dotnet:mainfrom
Evangelink:dev/amauryleve/combinatorial-pack-tests

Conversation

@Evangelink

Copy link
Copy Markdown
Member

Summary

Replaces full boolean cartesian-product [DataRow(true)] / [DataRow(false)] sets in Microsoft.NET.Pack.Tests with the [CombinatorialData] attribute from the Combinatorial.MSTest package.

What changed

  • GivenThatWeWantToPackAHelloWorldProject.cs: The method It_packs_with_release_if_PackRelease_property_set previously had two explicit [DataRow] attributes to cover both true and false for its bool optedOut parameter. These are replaced with a single [CombinatorialData] attribute, which automatically generates all boolean combinations — identical executed test cases, zero behavioral change.

  • Microsoft.NET.Pack.Tests.csproj: Added an ItemGroup with:

    • <PackageReference Include="Combinatorial.MSTest" /> — the package providing the attribute
    • <Using Include="Combinatorial.MSTest" /> — global using so the attribute is available without an explicit using directive

Why

Full boolean [DataRow] expansions are mechanical boilerplate. [CombinatorialData] expresses the same intent more concisely and scales automatically when additional bool parameters are added.

This is part of a per-project series applying the same mechanical transformation across the SDK test suite.

Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

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