Skip to content

Use Combinatorial.MSTest for boolean DataRow tests in Microsoft.DotNet.PackageInstall.Tests - #55011

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

Use Combinatorial.MSTest for boolean DataRow tests in Microsoft.DotNet.PackageInstall.Tests#55011
Evangelink wants to merge 1 commit into
dotnet:mainfrom
Evangelink:dev/amauryleve/combinatorial-packageinstall-tests

Conversation

@Evangelink

Copy link
Copy Markdown
Member

Summary

In test/Microsoft.DotNet.PackageInstall.Tests, replace full boolean cartesian-product [DataRow] sets with [CombinatorialData] from the Combinatorial.MSTest package.

What changed

  • 23 test methods across 3 files (ToolPackageDownloaderTests.cs, ToolPackageInstallerNugetCacheTests.cs, ToolPackageUninstallerTests.cs) had patterns like:
    [DataRow(false)]
    [DataRow(true)]
    public void SomeTest(bool flag) { ... }
    replaced with:
    [CombinatorialData]
    public void SomeTest(bool flag) { ... }
  • The .csproj gains an ItemGroup with <PackageReference Include="Combinatorial.MSTest" /> and <Using Include="Combinatorial.MSTest" />.
  • Identical executed test cases — no behavioral change; MSTest will still run the method with both false and true.

Why

[CombinatorialData] is cleaner and scales better: adding a second parameter automatically generates all combinations without manually listing every [DataRow]. This is part of a per-project series converting boolean/enum cartesian [DataRow] sets 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