forked from MapsterMapper/Mapster
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestAll.cs
More file actions
30 lines (26 loc) · 1 KB
/
Copy pathTestAll.cs
File metadata and controls
30 lines (26 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
using BenchmarkDotNet.Attributes;
using Mapster.Benchmark.Development.Classes;
namespace Mapster.Benchmark.Development.Benchmarks
{
public class TestAll
{
private Foo _fooInstance;
private Customer _customerInstance;
[Params(100_000)]//, 1_000_000)]
public int Iterations { get; set; }
[Benchmark]
public void MapsterTest()
{
TestAdaptHelper.TestMapsterAdapter<Foo, Foo>(_fooInstance, Iterations);
TestAdaptHelper.TestMapsterAdapter<Customer, CustomerDTO>(_customerInstance, Iterations);
}
[GlobalSetup(Target = nameof(MapsterTest))]
public void SetupMapster()
{
_fooInstance = TestAdaptHelper.SetupFooInstance();
_customerInstance = TestAdaptHelper.SetupCustomerInstance();
TestAdaptHelper.ConfigureMapster(_fooInstance, MapsterCompilerType.Default);
TestAdaptHelper.ConfigureMapster(_customerInstance, MapsterCompilerType.Default);
}
}
}