Skip to content

Use Combinatorial.MSTest for boolean DataRow tests in Microsoft.NET.Build.Tasks.Tests - #55010

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

Use Combinatorial.MSTest for boolean DataRow tests in Microsoft.NET.Build.Tasks.Tests#55010
Evangelink wants to merge 1 commit into
dotnet:mainfrom
Evangelink:dev/amauryleve/combinatorial-build-tasks-tests

Conversation

@Evangelink

Copy link
Copy Markdown
Member

Summary

Replaces full boolean cartesian-product [DataRow] sets with [CombinatorialData] in the Microsoft.NET.Build.Tasks.Tests project.

What changed

  • 8 test methods across two files (GivenADependencyContextBuilder.cs, GivenAResolvePackageDependenciesTask.cs) had patterns like:
    [DataRow(true)]
    [DataRow(false)]
    public void SomeTest(bool flag) { ... }
    replaced with:
    [CombinatorialData]
    public void SomeTest(bool flag) { ... }
  • The executed test cases are identical[CombinatorialData] automatically generates true/false for each bool parameter.
  • Microsoft.NET.Build.Tasks.Tests.csproj gains a new ItemGroup with:
    • <PackageReference Include="Combinatorial.MSTest" />
    • <Using Include="Combinatorial.MSTest" /> (global using, no per-file import needed)

Why

Full boolean [DataRow] enumerations are boilerplate that Combinatorial.MSTest handles automatically and more readably. This is part of a per-project series applying this pattern across the SDK test suite.

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

…uild.Tasks.Tests

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