✅ Benchmarks not running
This is my
This is my
The benchmarks are not running for some reason
Benchmarks.cs
file
using System.Security.Cryptography;
using BenchmarkDotNet.Attributes;
namespace DirectoryDiff;
public class BenchmarksHash
{
[MemoryDiagnoser]
public class GetHashComparison
{
static string testFile1path = @"U:\fdb\2024-07-26 18.48.10.jpg";
static FileInfo testFile1 = new(testFile1path);
static SHA256 sha256 = SHA256.Create();
[Benchmark]
public static void TestHashBytes() => FileUtils.GetFileHashBytes(testFile1, sha256);
[Benchmark]
public static void TestHashString() => FileUtils.GetFileHashString(testFile1, sha256);
}
}
using System.Security.Cryptography;
using BenchmarkDotNet.Attributes;
namespace DirectoryDiff;
public class BenchmarksHash
{
[MemoryDiagnoser]
public class GetHashComparison
{
static string testFile1path = @"U:\fdb\2024-07-26 18.48.10.jpg";
static FileInfo testFile1 = new(testFile1path);
static SHA256 sha256 = SHA256.Create();
[Benchmark]
public static void TestHashBytes() => FileUtils.GetFileHashBytes(testFile1, sha256);
[Benchmark]
public static void TestHashString() => FileUtils.GetFileHashString(testFile1, sha256);
}
}
Program.cs
file
using System.Security.Cryptography;
using BenchmarkDotNet.Running;
using DirectoryDiff;
class Program
{
public static void Main()
{
BenchmarkRunner.Run<BenchmarksHash>();
}
}
using System.Security.Cryptography;
using BenchmarkDotNet.Running;
using DirectoryDiff;
class Program
{
public static void Main()
{
BenchmarkRunner.Run<BenchmarksHash>();
}
}
1 Reply
fixed it, needed to call the subclass