As I sems the issue is the difference in the methord Signature
.Callback(() => FakeCaptureTargetScreen(
"Test", // Replace with Real value
100, // Replace with Real value
50, // Replace with Real value
bmp => {
// Process the captured Bitmap (bmp) here
Console.WriteLine("Bitmap captured!");
}
));
As for the second
Can it be simpified?
I did some reserch ans found specify argument matchers like It.IsAny() are requird for each parameter and Moq does not provide a built-in shorthand to match any value for all parameters. Each parameter must be specified explicitly. For example, your setup must be written as
_mockScreener
.Setup(x => x.CaptureTargetScreen(
It.IsAny<string>(),
It.IsAny<int>(),
It.IsAny<int>(),
It.IsAny<Action<Bitmap>>()
));