NUnit.Framework.Assertions.TestSandBox.MethodRunner.Run(System.Reflection.MethodInfo, params object[])

Here are the examples of the csharp api class NUnit.Framework.Assertions.TestSandBox.MethodRunner.Run(System.Reflection.MethodInfo, params object[]) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

1 Example 7

1. Example

Project: nunit
Source File: LowTrustFixture.cs
View license
public object Run(MethodInfo method, params object[] parameters)
        {
            if (method == null) throw new ArgumentNullException("method");
            if (_appDomain == null) throw new ObjectDisposedException(null);

            var methodRunnerType = typeof(MethodRunner);
            var methodRunnerProxy = (MethodRunner)_appDomain.CreateInstanceAndUnwrap(
                methodRunnerType.Assembly.FullName, methodRunnerType.FullName);

            try
            {
                return methodRunnerProxy.Run(method, parameters);
            }
            catch (Exception e)
            {
                throw e is TargetInvocationException
                    ? e.InnerException
                    : e;
            }
        }