diff --git a/Recyclable.Collections.Benchmarks/Benchmarks/RecyclableCollections.Benchmarks.cs b/Recyclable.Collections.Benchmarks/Benchmarks/RecyclableCollections.Benchmarks.cs index a17bae3..69928cc 100644 --- a/Recyclable.Collections.Benchmarks/Benchmarks/RecyclableCollections.Benchmarks.cs +++ b/Recyclable.Collections.Benchmarks/Benchmarks/RecyclableCollections.Benchmarks.cs @@ -66,7 +66,7 @@ namespace Recyclable.Collections.Benchmarks )] public override RecyclableCollectionsBenchmarkSource BenchmarkType { get => base.BenchmarkType; set => base.BenchmarkType = value; } - protected override Action GetTestMethod(RecyclableCollectionsBenchmarkSource benchmarkType) + protected override Action? GetTestMethod(RecyclableCollectionsBenchmarkSource benchmarkType) => (Action?) GetType().GetMethod($"{benchmarkType}_{TestCase}", BindingFlags.Instance | BindingFlags.Public)?.CreateDelegate(typeof(Action), this) ?? throw CreateMethodNotFoundException($"{benchmarkType}_{TestCase}", GetType().FullName); } diff --git a/Recyclable.Collections.Benchmarks/POC/PocBenchmarkBase.cs b/Recyclable.Collections.Benchmarks/POC/PocBenchmarkBase.cs index 1a12327..4cb0b6c 100644 --- a/Recyclable.Collections.Benchmarks/POC/PocBenchmarkBase.cs +++ b/Recyclable.Collections.Benchmarks/POC/PocBenchmarkBase.cs @@ -94,7 +94,7 @@ namespace Recyclable.Collections.Benchmarks.POC { Console.WriteLine($"******* SETTING UP TEST CASE FOR BENCHMARK {{{BenchmarkType}}} *******"); - if (BaselineBenchmarkType != null) + if (!EqualityComparer.Default.Equals(BaselineBenchmarkType, default)) { Console.WriteLine("******* SETTING UP BASELINE DATA *******"); PrepareData(BaselineBenchmarkType); diff --git a/Recyclable.Collections.Benchmarks/RecyclableBenchmarkBase.cs b/Recyclable.Collections.Benchmarks/RecyclableBenchmarkBase.cs index 2123d94..602cd79 100644 --- a/Recyclable.Collections.Benchmarks/RecyclableBenchmarkBase.cs +++ b/Recyclable.Collections.Benchmarks/RecyclableBenchmarkBase.cs @@ -52,6 +52,9 @@ namespace Recyclable.Collections.Benchmarks Console.WriteLine($"******* PREPARING DATA FOR {benchmarkType} *******"); switch (benchmarkType) { + case RecyclableCollectionsBenchmarkSource.Unknown: + break; + case RecyclableCollectionsBenchmarkSource.Array: _testObjects ??= DataGenerator.EnumerateTestObjects(TestObjectCount); break;