public static void RunMethod(this ApplicationInstance applicationInstance,
                                     Expression<Func<Task>> staticMethodToExecute,
            TestInjectorSettings testInjectorSettings = null)
        {
            //Retrieve the property that has changed
            var body = staticMethodToExecute.Body as System.Linq.Expressions.MemberExpression;
            if (body == null)
                throw new InvalidOperationException("Could not convert expression into a method call");

            var method = body.Member as MethodInfo;
            if (method == null)
                throw new InvalidOperationException("Could not convert expression into a method call");

            RunMethodImpl(applicationInstance, method, testInjectorSettings);
        }
        public static void Run(this ApplicationInstance applicationInstance,
                               Action staticMethodToExecute, 
            TestInjectorSettings testInjectorSettings = null)
        {
            var methodInfo =
            #if NET40
                staticMethodToExecute.Method;
            #else
                staticMethodToExecute.GetMethodInfo();
            #endif
            if (!methodInfo.IsStatic)
                throw new InvalidOperationException("Method must be static - don't reference any outside parameters");

            RunMethodImpl(applicationInstance, methodInfo, testInjectorSettings);
        }
        private static void RunMethodImpl(ApplicationInstance applicationInstance, MethodInfo method, TestInjectorSettings testInjectorSettings)
        {
            if (!method.IsStatic)
                throw new InvalidOperationException("Method must be static");

            new TestInjectorClient().RunMethod(applicationInstance.Process,
                                               method.DeclaringType,
                                               method.Name,
                                               testInjectorSettings ?? TestInjectorSettings.Default);
        }