Currently, I am in the process of developing a c# application with an embedded web browser control. In this project, I'm facing a challenge where I need to call a C# method from JavaScript and pass a JavaScript callback using the dynamic technique explained in this stackoverflow answer:
public void CallbackTest(object callback)
{
dynamic callbackFunc = callback;
callbackFunc("Hello!");
}
I am now stuck on how to proceed with unit testing for this method. Specifically, I am unsure of how to mock or fake the callback parameter. For context, I usually use Moq as my preferred mocking library.