I'm writing unit tests using RhinoMocks for mocking, and now I'm in need of some new functionality which I haven't used before.
I'd like to call a function, which again will call an async function. To simulate that the async function finishes and triggers the given callback with the result from execution I assume I can use the Callback functionality in RhinoMocks, but how do I do this?
Basically what I'd like to do is something like this:
fakeSomething = MockRepository.GenerateMock<ISomething>();
fakeSomething.FictionousFunctionSettingCallback(MyFunctionCalled, MyCallback, theParameterToGiveCallback);
var myObj = new MyClass(fakeSomething);
myObj.Foo();
// Foo() now fires the function MyFunctionCalled asynchronous,
// and eventually would trigger some callback
So; is there a true function I can replace this "FictionousFunction" with to set this up? Please ask if this was unclear..