Skip to content

Commit

Permalink
Use TheoryData for strongly typed test data
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveDesmond-ca committed Nov 29, 2024
1 parent c206b3a commit 47f6a01
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions BenchmarkMockNet.Tests/BenchmarkTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,17 @@ public static class BenchmarkTests
{ typeof(Verify), result => result is null }
};

public static IEnumerable<object[]> Matrix
public static TheoryData<Type, MethodInfo> Matrix
{
get
{
var matrix = new List<object[]>();
var matrix = new TheoryData<Type, MethodInfo>();
foreach (var benchmark in Benchmarks)
{
matrix.AddRange(Methods.Select(method => new object[] { benchmark.Key, method }));
foreach (var method in Methods)
{
matrix.Add(benchmark.Key, method);
}
}

return matrix;
Expand Down

0 comments on commit 47f6a01

Please sign in to comment.