Skip to content

Commit b141836

Browse files
committed
mock factory
1 parent db8f8d8 commit b141836

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/BenchmarkDotNet.Tests/Mocks/MockFactory.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,21 @@ public static Summary CreateSummary(Type benchmarkType)
3232
ImmutableArray<IColumnHidingRule>.Empty);
3333
}
3434

35+
public static Summary CreateSummary(IConfig config, params Type[] benchmarkTypes)
36+
{
37+
var runInfos = benchmarkTypes.Select(type => BenchmarkConverter.TypeToBenchmarks(type, config));
38+
return new Summary(
39+
"MockSummary",
40+
runInfos.SelectMany(i => i.BenchmarksCases.Select((benchmark, index) => CreateReport(benchmark, 5, (index + 1) * 100))).ToImmutableArray(),
41+
new HostEnvironmentInfoBuilder().WithoutDotNetSdkVersion().Build(),
42+
string.Empty,
43+
string.Empty,
44+
TimeSpan.FromMinutes(1),
45+
TestCultureInfo.Instance,
46+
ImmutableArray<ValidationError>.Empty,
47+
ImmutableArray<IColumnHidingRule>.Empty);
48+
}
49+
3550
public static Summary CreateSummary(IConfig config) => new Summary(
3651
"MockSummary",
3752
CreateReports(config),

0 commit comments

Comments
 (0)