Skip to content

Instantly share code, notes, and snippets.

@xerxesb
Created May 11, 2011 10:28
Show Gist options
  • Save xerxesb/966252 to your computer and use it in GitHub Desktop.
Save xerxesb/966252 to your computer and use it in GitHub Desktop.
Using Fasterflect to invoke AssertWasCalled<T>(this T mock, Action<T>)
This doesn't work - it says "No match for method with name AssertWasCalled and flags Instance | NonPublic | Public | Static on type Rhino.Mocks.RhinoMocksExtensions"
public static void CallUsingReflection<T>(T mock, Action<T> action)
{
RhinoAssembly.GetType("Rhino.Mocks.RhinoMocksExtensions").CallMethod(new[] { typeof(T) }, "AssertWasCalled", new object[] { mock, action });
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment