forked from MapsterMapper/Mapster
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestComplexTypes.cs
More file actions
26 lines (22 loc) · 775 Bytes
/
Copy pathTestComplexTypes.cs
File metadata and controls
26 lines (22 loc) · 775 Bytes
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
using BenchmarkDotNet.Attributes;
using Mapster.Benchmark.Development.Classes;
namespace Mapster.Benchmark.Development.Benchmarks
{
public class TestComplexTypes
{
private Customer _customerInstance;
[Params(1000, 10_000, 100_000, 1_000_000)]
public int Iterations { get; set; }
[Benchmark]
public void MapsterTest()
{
TestAdaptHelper.TestMapsterAdapter<Customer, CustomerDTO>(_customerInstance, Iterations);
}
[GlobalSetup(Target = nameof(MapsterTest))]
public void SetupMapster()
{
_customerInstance = TestAdaptHelper.SetupCustomerInstance();
TestAdaptHelper.ConfigureMapster(_customerInstance, MapsterCompilerType.Default);
}
}
}