Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
92a7b30
chore: update xunit related package version to v3 with mtp v2
filzrev Mar 7, 2026
d886e93
chore: add xunit.v3.mtp-v2 package directly for auto-generated entryp…
filzrev Mar 7, 2026
0831b9b
chore: remove using Xunit.Abstractions; and add using Xunit
filzrev Mar 7, 2026
1050ae2
chore: add using Xunit.Sdk statement for XunitSerializable
filzrev Mar 7, 2026
e5e9134
chore: fix xUnit3003 analyzer errors
filzrev Mar 7, 2026
7cd6625
chore: remove unittests project dependency from integration tests pro…
filzrev Mar 7, 2026
b4961e1
chore: modify theorydata related incompatible codes
filzrev Mar 7, 2026
3f96ad5
chore: add global.json to use Microsoft.Testing.Platform by dotnet test
filzrev Mar 28, 2026
d9d0e8e
chore: add tests/.editorconfig
filzrev Mar 29, 2026
35a945e
chore: fix custom inlinedata attribute
filzrev Mar 29, 2026
f0e4956
chore: fix wasm related tests
filzrev Mar 29, 2026
0ee22fb
chore: suppress MSB3277 warnings
filzrev Mar 30, 2026
3acad30
chore: migrate multipleframeworks tests to tunit
filzrev Mar 30, 2026
04b121e
chore: update build project to support mtp
filzrev Mar 30, 2026
b0fdb44
chore: revert console log level to normal
filzrev Mar 30, 2026
771620d
chore: modify reference files link paths
filzrev Mar 30, 2026
6efaf51
chore: suppress auto-entrypoint generation of benchmark project templ…
filzrev Mar 30, 2026
4c8ddec
chore: add setting to suppress entrypoint generation for NativeAot
filzrev Apr 1, 2026
978e1da
chore: fix run-tests-selected workflow
filzrev Apr 2, 2026
2d622bf
chore: add setting for ci on windows-11-arm
filzrev Apr 3, 2026
af83e4d
chore: move PreferNativeArm64 setting to Directory.Build.targets
filzrev Apr 3, 2026
b68620f
chore: cleanup compile item references and file name
filzrev Apr 6, 2026
4320482
chore: temporary skip disassemble tests for macos
filzrev Apr 6, 2026
56c1f9b
chore: add diagnostic logs and collect as artifacts
filzrev Apr 6, 2026
ea02ea2
chore: update generate-coverage-report.yaml
filzrev Apr 6, 2026
a9c31d5
chore: add isinprocess condition to skip tests
filzrev Apr 9, 2026
d1eeaa1
chore: modify test filter to exclude all wasm tests
filzrev Apr 9, 2026
e341b0d
chore: add setting to use native mtp entrypoint
filzrev Apr 12, 2026
fe13273
chore: remove mtp trx report package and use xunit's trx reporter ins…
filzrev Apr 15, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/generate-coverage-report.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ jobs:

- name: Collect Code Coverage
run: |
dotnet coverage connect bdn_coverage "dotnet test tests/BenchmarkDotNet.Tests -c Release --no-build --framework net8.0"
dotnet coverage connect bdn_coverage "dotnet test tests/BenchmarkDotNet.Analyzers.Tests -c Release --no-build --framework net8.0"
dotnet coverage connect bdn_coverage "dotnet test --project tests/BenchmarkDotNet.Tests -c Release --no-build --framework net8.0"
dotnet coverage connect bdn_coverage "dotnet test --project tests/BenchmarkDotNet.Analyzers.Tests -c Release --no-build --framework net8.0"

- name: Collect Code Coverage for BenchmarkDotNet.IntegrationTests
if: ${{ github.event.inputs.skip_integration_tests == 'false'}}
run: |
dotnet coverage connect bdn_coverage 'dotnet test tests/BenchmarkDotNet.IntegrationTests -c Release --no-build --framework net8.0 --filter "(FullyQualifiedName!~DotMemoryTests) & (FullyQualifiedName!~DotTraceTests) & (FullyQualifiedName!~WasmIsSupported) & (FullyQualifiedName!~WasmSupportsInProcessDiagnosers)"'
dotnet coverage connect bdn_coverage 'dotnet test --project tests/BenchmarkDotNet.IntegrationTests -c Release --no-build --framework net8.0 --filter-query "/*/*/(!*DotMemoryTests)&(!*DotTraceTests)&(!*WasmTests)"' --no-ansi --output Detailed

- name: Shutdown dotnet-coverage server.
run: dotnet coverage shutdown bdn_coverage --timeout 60000
Expand Down Expand Up @@ -80,13 +80,13 @@ jobs:

- name: Collect Code Coverage
run: |
dotnet coverage connect bdn_coverage "dotnet test tests/BenchmarkDotNet.Tests -c Release --no-build --framework net472"
dotnet coverage connect bdn_coverage "dotnet test tests/BenchmarkDotNet.Analyzers.Tests -c Release --no-build --framework net472"
dotnet coverage connect bdn_coverage "dotnet test --project tests/BenchmarkDotNet.Tests -c Release --no-build --framework net472"
dotnet coverage connect bdn_coverage "dotnet test --project tests/BenchmarkDotNet.Analyzers.Tests -c Release --no-build --framework net472"

- name: Collect Code Coverage for BenchmarkDotNet.IntegrationTests
if: ${{ github.event.inputs.skip_integration_tests == 'false'}}
run: |
dotnet coverage connect bdn_coverage 'dotnet test tests/BenchmarkDotNet.IntegrationTests -c Release --no-build --framework net472 --filter "(FullyQualifiedName!~DotMemoryTests) & (FullyQualifiedName!~DotTraceTests) & (FullyQualifiedName!~WasmIsSupported) & (FullyQualifiedName!~WasmSupportsInProcessDiagnosers)"'
dotnet coverage connect bdn_coverage 'dotnet test --project tests/BenchmarkDotNet.IntegrationTests -c Release --no-build --framework net472 --filter-query "/*/*/(!*DotMemoryTests)&(!*DotTraceTests)&(!*WasmTests)"' --no-ansi --output Detailed

- name: Shutdown dotnet-coverage server.
run: dotnet coverage shutdown bdn_coverage --timeout 60000
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/run-tests-selected.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ on:
- net472
filter:
type: string
description: Test filter text (It's used for `dotnet test --filter`) Use default value when running all tests
description: Test filter text (It's used for `dotnet test --filter-method`) Use default value when running all tests
required: true
default: "BenchmarkDotNet"
iteration_count:
Expand Down Expand Up @@ -91,12 +91,13 @@ jobs:
run: |
$PSNativeCommandUseErrorActionPreference = $true
$iterationCount = ${{ inputs.iteration_count }}

Write-Host ("OSArchitecture" + [System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture)

foreach($i in 1..$iterationCount) {
Write-Output ('##[group]Executing Iteration: {0}/${{ inputs.iteration_count }}' -f $i)

dotnet test -c Release --framework ${{ inputs.framework }} --filter ${{ inputs.filter }} -tl:off --no-build --logger "console;verbosity=normal"

dotnet test -c Release --framework ${{ inputs.framework }} --no-build --filter-method "${{ inputs.filter }}" --no-ansi
Write-Output '##[endgroup]'
}

Expand Down
16 changes: 12 additions & 4 deletions .github/workflows/run-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ jobs:
if: always()
with:
name: test-windows-core-trx-${{ github.run_id }}-${{ matrix.os }}
path: "**/*.trx"
path: |
**/*.trx
**/log_*.diag

test-windows-full:
strategy:
Expand Down Expand Up @@ -116,7 +118,9 @@ jobs:
if: always()
with:
name: test-windows-full-trx-${{ github.run_id }}-${{ matrix.os }}
path: "**/*.trx"
path: |
**/*.trx
**/log_*.diag

test-linux:
strategy:
Expand Down Expand Up @@ -164,7 +168,9 @@ jobs:
if: always()
with:
name: test-linux-trx-${{ github.run_id }}-${{ matrix.os }}
path: "**/*.trx"
path: |
**/*.trx
**/log_*.diag

test-macos:
name: test-macos (${{ matrix.os.arch }})
Expand Down Expand Up @@ -211,7 +217,9 @@ jobs:
if: always()
with:
name: test-macos(${{ matrix.os.arch }})-trx-${{ github.run_id }}
path: "**/*.trx"
path: |
**/*.trx
**/log_*.diag

test-pack:
runs-on: ubuntu-latest
Expand Down
2 changes: 2 additions & 0 deletions BenchmarkDotNet.slnx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@
<Project Path="templates/BenchmarkDotNet.Templates.csproj" />
</Folder>
<Folder Name="/tests/">
<File Path="tests/.editorconfig" />
<File Path="tests/Directory.Build.props" />
<File Path="tests/Directory.Build.targets" />
<Project Path="tests/BenchmarkDotNet.Analyzers.Tests/BenchmarkDotNet.Analyzers.Tests.csproj" />
<Project Path="tests/BenchmarkDotNet.Exporters.Plotting.Tests/BenchmarkDotNet.Exporters.Plotting.Tests.csproj" />
<Project Path="tests/BenchmarkDotNet.IntegrationTests.ConfigPerAssembly/BenchmarkDotNet.IntegrationTests.ConfigPerAssembly.csproj" />
Expand Down
2 changes: 1 addition & 1 deletion build/BenchmarkDotNet.Build/BenchmarkDotNet.Build.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<NoWarn>$(NoWarn);CA2007</NoWarn>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Cake.Frosting" Version="6.0.0" />
<PackageReference Include="Cake.Frosting" Version="6.1.0" />
<PackageReference Include="Cake.FileHelpers" Version="7.0.0" />
<PackageReference Include="Cake.Git" Version="5.0.1" />
<PackageReference Include="Docfx.App" Version="2.78.5" />
Expand Down
13 changes: 11 additions & 2 deletions build/BenchmarkDotNet.Build/Runners/UnitTestRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
using Cake.Common.Diagnostics;
using Cake.Common.Tools.DotNet;
using Cake.Common.Tools.DotNet.Test;
using Cake.Core;
using Cake.Core.IO;
using System.Linq;
using System.Runtime.InteropServices;

namespace BenchmarkDotNet.Build.Runners;
Expand Down Expand Up @@ -41,11 +43,18 @@ private DotNetTestSettings GetTestSettingsParameters(FilePath logFile, string tf
Framework = tfm,
NoBuild = true,
NoRestore = true,
Loggers = new[] { "trx", $"trx;LogFileName={logFile.FullPath}", "console;verbosity=detailed" },
EnvironmentVariables =
{
["Platform"] = "" // force the tool to not look for the .dll in platform-specific directory
}
},
PathType = DotNetTestPathType.Auto,
ArgumentCustomization = args
=> args.Append("--report-xunit-trx")
.AppendSwitchQuoted("--report-xunit-trx-filename", System.IO.Path.GetFileName(logFile.FullPath))
.Append("--no-ansi")
.AppendSwitch("--output", "Detailed")
.Append("--diagnostic")
.AppendSwitch("--diagnostic-verbosity", "Trace")
};
return settings;
}
Expand Down
5 changes: 5 additions & 0 deletions global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"test": {
"runner": "Microsoft.Testing.Platform"
}
}
1 change: 1 addition & 0 deletions src/BenchmarkDotNet/Templates/CsProj.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
<!-- Suppress warning for nuget package used in old (unsupported) tfm. -->
<SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings>
<StartupObject>BenchmarkDotNet.Autogenerated.UniqueProgramName</StartupObject>
<IsTestingPlatformApplication>false</IsTestingPlatformApplication>
</PropertyGroup>

<ItemGroup>
Expand Down
3 changes: 2 additions & 1 deletion src/BenchmarkDotNet/Templates/MonoAOTLLVMCsProj.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk" DefaultTarget="Publish">
<Project Sdk="Microsoft.NET.Sdk" DefaultTarget="Publish">
<PropertyGroup>
<OriginalCSProjPath>$CSPROJPATH$</OriginalCSProjPath>
<MonoPropsPath>$([System.IO.Path]::ChangeExtension('$(OriginalCSProjPath)', '.Mono.props'))</MonoPropsPath>
Expand All @@ -21,6 +21,7 @@
<SelfContained>true</SelfContained>
<!-- Suppress warning for nuget package used in old (unsupported) tfm. -->
<SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings>
<IsTestingPlatformApplication>false</IsTestingPlatformApplication>
</PropertyGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions src/BenchmarkDotNet/Templates/R2RCsProj.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
<StartupObject>BenchmarkDotNet.Autogenerated.UniqueProgramName</StartupObject>
<!-- workaround for 'Found multiple publish output files with the same relative path.' error -->
<ErrorOnDuplicatePublishOutputFiles>false</ErrorOnDuplicatePublishOutputFiles>
<IsTestingPlatformApplication>false</IsTestingPlatformApplication>
</PropertyGroup>

<PropertyGroup>
Expand Down
3 changes: 2 additions & 1 deletion src/BenchmarkDotNet/Templates/WasmCsProj.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="$SDKNAME$" DefaultTargets="publish">
<Project Sdk="$SDKNAME$" DefaultTargets="publish">
<PropertyGroup>
<OriginalCSProjPath>$CSPROJPATH$</OriginalCSProjPath>
<WasmPropsPath>$([System.IO.Path]::ChangeExtension('$(OriginalCSProjPath)', '.Wasm.props'))</WasmPropsPath>
Expand Down Expand Up @@ -26,6 +26,7 @@ $CORECLR_OVERRIDES$
<!-- Suppress warning for nuget package used in old (unsupported) tfm. -->
<SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings>
<StartupObject>BenchmarkDotNet.Autogenerated.UniqueProgramName</StartupObject>
<IsTestingPlatformApplication>false</IsTestingPlatformApplication>
</PropertyGroup>

<ItemGroup>
Expand Down
4 changes: 4 additions & 0 deletions src/BenchmarkDotNet/Toolchains/NativeAot/Generator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,10 @@ private string GenerateProjectForNuGetBuild(string projectFilePath, BuildPartiti
<SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings> <!-- Suppress warning for nuget package used in old (unsupported) tfm. -->
{GetInstructionSetSettings(buildPartition)}
</PropertyGroup>
<PropertyGroup>
<IsTestingPlatformApplication>false</IsTestingPlatformApplication>
<XunitAutoGeneratedEntryPoint>false</XunitAutoGeneratedEntryPoint>
</PropertyGroup>
{GetRuntimeSettings(buildPartition.RepresentativeBenchmarkCase.Job.Environment.Gc, buildPartition.Resolver)}
<ItemGroup>
<Compile Include="{Path.GetFileName(artifactsPaths.ProgramCodePath)}" Exclude="bin\**;obj\**;**\*.xproj;packages\**" />
Expand Down
7 changes: 7 additions & 0 deletions tests/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
root = false

# C# files
[*.cs]
# xUnit1051: Calls to methods which accept CancellationToken should use TestContext.Current.CancellationToken to allow test cancellation to be more responsive.
dotnet_diagnostic.xUnit1051.severity = suggestion

Original file line number Diff line number Diff line change
Expand Up @@ -1110,7 +1110,7 @@ public void BenchmarkMethod({{integerValueAndType.Value2}} a)
}

public static IEnumerable<string> DummyAttributeUsage
=> DummyAttributeUsageTheoryData;
=> DummyAttributeUsageTheoryData.Select(x => x.Data);

public static TheoryData<string> EmptyArgumentsAttributeUsagesWithMismatchingValueCount()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Xunit;

namespace BenchmarkDotNet.Analyzers.Tests.AnalyzerTests.Attributes;

public class GeneralParameterAttributesAnalyzerTests
{
public class MutuallyExclusiveOnField : AnalyzerTestFixture<GeneralParameterAttributesAnalyzer>
Expand Down Expand Up @@ -158,7 +159,7 @@ public class BenchmarkClass
}

public static TheoryData<string> UniqueParameterAttributeUsages
=> [.. UniqueParameterAttributesTheoryData.Select(tdr => (tdr[1] as string)!)];
=> [.. UniqueParameterAttributesTheoryData.Select(tdr => tdr.Data.Item2)];

public static TheoryData<string, int, int[]> DuplicateSameParameterAttributeUsages
=> DuplicateSameAttributeUsagesTheoryData;
Expand Down Expand Up @@ -320,7 +321,7 @@ public class BenchmarkClass
await RunAsync();
}

public static TheoryData<string> UniqueParameterAttributeUsages => [.. UniqueParameterAttributesTheoryData.Select(tdr => (tdr[1] as string)!)];
public static TheoryData<string> UniqueParameterAttributeUsages => [.. UniqueParameterAttributesTheoryData.Select(tdr => tdr.Data.Item2)];

public static TheoryData<string, int, int[]> DuplicateSameParameterAttributeUsages => DuplicateSameAttributeUsagesTheoryData;

Expand Down Expand Up @@ -479,21 +480,19 @@ public static IEnumerable<object[]> DuplicateAttributeUsageCountsAndNonPublicCla
=> CombinationsGenerator.CombineArguments(DuplicateParameterAttributeUsageCounts, NonPublicClassMemberAccessModifiers);

public static TheoryData<string> UniqueParameterAttributeUsages
=> [.. UniqueParameterAttributesTheoryData.Select(tdr => (tdr[1] as string)!)];
=> [.. UniqueParameterAttributesTheoryData.Select(tdr => tdr.Data.Item2)];

public static IEnumerable<(string AttributeName, string AttributeUsage)> UniqueParameterAttributes
=> UniqueParameterAttributesTheoryData.Select(tdr => ((tdr[0] as string)!, (tdr[1] as string)!));
=> UniqueParameterAttributesTheoryData.Select(tdr => (tdr.Data.Item1, tdr.Data.Item2));

public static IEnumerable<string> NonPublicClassMemberAccessModifiers
#pragma warning disable IDE0028 // Simplify collection initialization
=> new NonPublicClassMemberAccessModifiersTheoryData();
#pragma warning restore IDE0028 // Simplify collection initialization
=> new NonPublicClassMemberAccessModifiersTheoryData().Select(x => x.Data);

public static IEnumerable<(string CurrentUniqueAttributeUsage, int CurrentUniqueAttributeUsagePosition, int[] Counts)> DuplicateSameParameterAttributeUsages
=> DuplicateSameAttributeUsagesTheoryData.Select(tdr => ((tdr[0] as string)!, (int) tdr[1], (tdr[2] as int[])!));
=> DuplicateSameAttributeUsagesTheoryData.Select(tdr => (tdr.Data.Item1, tdr.Data.Item2, tdr.Data.Item3));

public static IEnumerable<int[]> DuplicateParameterAttributeUsageCounts
=> DuplicateAttributeUsageCountsTheoryData;
=> DuplicateAttributeUsageCountsTheoryData.Select(x => x.Data);
}

public class PropertyMustBePublic : AnalyzerTestFixture<GeneralParameterAttributesAnalyzer>
Expand Down Expand Up @@ -648,18 +647,16 @@ public static IEnumerable<object[]> DuplicateAttributeUsageCountsAndNonPublicCla
=> CombinationsGenerator.CombineArguments(DuplicateParameterAttributeUsageCounts, NonPublicClassMemberAccessModifiers);

public static TheoryData<string> UniqueParameterAttributeUsages
=> [.. UniqueParameterAttributesTheoryData.Select(tdr => (tdr[1] as string)!)];
=> [.. UniqueParameterAttributesTheoryData.Select(tdr => tdr.Data.Item2)];

public static IEnumerable<(string AttributeName, string AttributeUsage)> UniqueParameterAttributes
=> UniqueParameterAttributesTheoryData.Select(tdr => ((tdr[0] as string)!, (tdr[1] as string)!));
=> UniqueParameterAttributesTheoryData.Select(tdr => (tdr.Data.Item1, tdr.Data.Item2));

public static IEnumerable<string> NonPublicClassMemberAccessModifiers
#pragma warning disable IDE0028 // Simplify collection initialization
=> new NonPublicClassMemberAccessModifiersTheoryData();
#pragma warning restore IDE0028 // Simplify collection initialization
=> new NonPublicClassMemberAccessModifiersTheoryData().Select(x => x.Data);

public static IEnumerable<(string CurrentUniqueAttributeUsage, int CurrentUniqueAttributeUsagePosition, int[] Counts)> DuplicateSameParameterAttributeUsages
=> DuplicateSameAttributeUsagesTheoryData.Select(tdr => ((tdr[0] as string)!, (int) tdr[1], (tdr[2] as int[])!));
=> DuplicateSameAttributeUsagesTheoryData.Select(tdr => (tdr.Data.Item1, tdr.Data.Item2, tdr.Data.Item3));

public static TheoryData<int[]> DuplicateParameterAttributeUsageCounts
=> DuplicateAttributeUsageCountsTheoryData;
Expand Down Expand Up @@ -813,7 +810,7 @@ public class BenchmarkClass
}

public static TheoryData<string> UniqueParameterAttributeUsages
=> [.. UniqueParameterAttributesTheoryData.Select(tdr => (tdr[1] as string)!)];
=> [.. UniqueParameterAttributesTheoryData.Select(tdr => tdr.Data.Item2)];

public static TheoryData<string, string> UniqueParameterAttributes
=> UniqueParameterAttributesTheoryData;
Expand Down Expand Up @@ -951,7 +948,7 @@ public class BenchmarkClass
}

public static TheoryData<string> UniqueParameterAttributeUsages
=> [.. UniqueParameterAttributesTheoryData.Select(tdr => (tdr[1] as string)!)];
=> [.. UniqueParameterAttributesTheoryData.Select(tdr => tdr.Data.Item2)];

public static TheoryData<string, string> UniqueParameterAttributes
=> UniqueParameterAttributesTheoryData;
Expand Down Expand Up @@ -1113,7 +1110,7 @@ public class BenchmarkClass
}

public static TheoryData<string> UniqueParameterAttributeUsages
=> [.. UniqueParameterAttributesTheoryData.Select(tdr => (tdr[1] as string)!)];
=> [.. UniqueParameterAttributesTheoryData.Select(tdr => tdr.Data.Item2)];

public static TheoryData<string, string> UniqueParameterAttributes
=> UniqueParameterAttributesTheoryData;
Expand Down Expand Up @@ -1278,20 +1275,20 @@ public static IEnumerable<object[]> DuplicateAttributeUsageCountsAndNonPublicPro
=> CombinationsGenerator.CombineArguments(DuplicateParameterAttributeUsageCounts, NonPublicPropertySetters());

public static TheoryData<string> UniqueParameterAttributeUsages
=> [.. UniqueParameterAttributesTheoryData.Select(tdr => (tdr[1] as string)!)];
=> [.. UniqueParameterAttributesTheoryData.Select(tdr => tdr.Data.Item2)];

public static IEnumerable<(string AttributeName, string AttributeUsage)> UniqueParameterAttributes
=> UniqueParameterAttributesTheoryData.Select(tdr => ((tdr[0] as string)!, (tdr[1] as string)!));
=> UniqueParameterAttributesTheoryData.Select(tdr => (tdr.Data.Item1, tdr.Data.Item2));

public static IEnumerable<(string CurrentUniqueAttributeUsage, int CurrentUniqueAttributeUsagePosition, int[] Counts)> DuplicateSameParameterAttributeUsages
=> DuplicateSameAttributeUsagesTheoryData.Select(tdr => ((tdr[0] as string)!, (int) tdr[1], (tdr[2] as int[])!));
=> DuplicateSameAttributeUsagesTheoryData.Select(tdr => (tdr.Data.Item1, tdr.Data.Item2, tdr.Data.Item3));

public static TheoryData<int[]> DuplicateParameterAttributeUsageCounts
=> DuplicateAttributeUsageCountsTheoryData;

public static IEnumerable<string> NonPublicPropertySetters()
=> new NonPublicPropertySetterAccessModifiersTheoryData()
.Select<string, string>(m => $"{{ get; {m} set; }}")
.Select(m => $"{{ get; {m.Data} set; }}")
.Concat(["{ get; }", "=> 0;"]);

public static TheoryData<string> NonPublicPropertySettersTheoryData()
Expand Down Expand Up @@ -1441,7 +1438,7 @@ public void Run() { }
await RunAsync();
}
}

public static TheoryData<string, string> UniqueParameterAttributesTheoryData
=> new()
{
Expand Down Expand Up @@ -1486,7 +1483,7 @@ private static IEnumerable<int[]> GenerateDuplicateAttributeUsageCombinations(Th
private static ReadOnlyCollection<(string CurrentUniqueAttributeUsage, int CurrentUniqueAttributeUsagePosition, int[] Counts)> GenerateDuplicateSameAttributeUsageCombinations(TheoryData<string, string> uniqueAttributeUsages)
{
var uniqueAttributeUsagesList = uniqueAttributeUsages
.Select(tdr => (tdr[1] as string)!)
.Select(tdr => tdr.Data.Item2)
.ToList()
.AsReadOnly();

Expand Down
Loading