I have the following classes:
public class HelperClass { HandleFunction<T>(Func<T> func) { // Custom logic here func.Invoke(); // Custom logic here } // The class i want to test public class MainClass { pubic readonly HelperClass _helper; //Ctor MainClass(HelperClass helper) { _helper = helper; } public void Foo() { // Use the handle method _helper.HandleFunction(() => {
I want to test only MainClass , I use RhinoMocks to mock HelperClass in my tests.
The problem is that although I am not interested in testing the HandleFunction() method, I am interested in checking Action1 , Action2 and other actions that were sent to HandleFunction() when called.
How can I mock the HandleFunction() method and, avoiding its internal logic, call the code that was sent to it as a parameter?
source share