コード例 #1
0
            private void RunTest(ITestCase test)
            {
                TestResult result = new TestResult(test);

                System.Runtime.CompilerServices.RuntimeHelpers.PrepareConstrainedRegions();
                try
                {
                    result.Start();
                    test.Run(this.fixtureInstance);
                    result.Success();
                }
                catch (Exception ex)
                {
                    Exception current = ex;
                    if (current is TargetInvocationException)
                    {
                        current = current.InnerException;
                    }
                    if (current is IgnoreException)
                    {
                        result.Ignore();
                    }
                    else if (current is AssumptionFailureException)
                    {
                        result.Success();
                    }
                    else
                    {
                        result.Fail(current);
                    }
                }
                this.Owner.TestListener.Test(result);
            }
コード例 #2
0
 private void RunTest(ITestCase test)
 {
     TestResult result = new TestResult(test);
     System.Runtime.CompilerServices.RuntimeHelpers.PrepareConstrainedRegions();
     try
     {
         result.Start();
         test.Run(this.fixtureInstance);
         result.Success();
     }
     catch (Exception ex)
     {
         Exception current = ex;
         if (current is TargetInvocationException)
             current = current.InnerException;
         if (current is IgnoreException)
             result.Ignore();
         else if (current is AssumptionFailureException)
             result.Success();
         else
             result.Fail(current);
     }
     this.Owner.TestListener.Test(result);
 }