Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 9f865a1028
Fetching contributors…

Cannot retrieve contributors at this time

38 lines (32 sloc) 0.95 kb
using System.Diagnostics;
using System.Reflection;
namespace CLAP
{
/// <summary>
/// A helper for method invoking to allow mocking for tests
/// </summary>
public static class MethodInvoker
{
public static IMethodInvoker Invoker { get; set; }
static MethodInvoker()
{
Invoker = new DefaultMethodInvoker();
}
public static void Invoke(MethodInfo method, object obj, object[] parameters)
{
Debug.Assert(method != null);
Invoker.Invoke(method, obj, parameters);
}
private class DefaultMethodInvoker : IMethodInvoker
{
public void Invoke(MethodInfo method, object obj, object[] parameters)
{
method.Invoke(obj, parameters);
}
}
}
public interface IMethodInvoker
{
void Invoke(MethodInfo method, object obj, object[] parameters);
}
}
Jump to Line
Something went wrong with that request. Please try again.