public void Verify() { try { TestRunner.Verify(_actionUnderTest.Description, _parameterActions, () => _performAction(_actionContainer), _dependencyActions, _assertions); } catch (Exception e) { Exception result = null; bool succeeded = true; try { result = new ExceptionRewriter().RewriteStacktrace(e); } catch { succeeded = false; } if (!succeeded) { throw; } throw result; } }
public static void VerifyThrowsException <TExceptionType>(string expectedExceptionMessage, params Action[] actions) where TExceptionType : Exception { var exceptionConfiguration = new ExceptionConfiguration(typeof(TExceptionType), expectedExceptionMessage); try { new TestVerifyClause(exceptionConfiguration).Verify(actions); } catch (Exception e) { Exception result = null; bool succeeded = true; try { result = new ExceptionRewriter().RewriteStacktrace(e); } catch { succeeded = false; } if (!succeeded) { throw; } throw result; } }
public void Verify(params Action[] actions) { try { var testStepCreators = new ITestStepCreator[] { new WithTestStep(), new WhenTestStep(), new ExpectTestStep(), new ShouldTestStep(), new DefaultTestStep() }; var steps = actions.Select(x => TestStepCreator(testStepCreators, x)).ToList(); Verify(steps, _exceptionConfiguration); } catch (Exception e) { Exception result = null; bool succeeded = true; try { result = new ExceptionRewriter().RewriteStacktrace(e); } catch { succeeded = false; } if (!succeeded) { throw; } throw result; } }
public static void Verify(params Action[] actions) { try { new TestVerifyClause().Verify(actions); } catch (Exception e) { Exception result = null; bool succeeded = true; try { result = new ExceptionRewriter().RewriteStacktrace(e); } catch { succeeded = false; } if (!succeeded) { throw; } throw result; } }
public void BeforeEachTest() { _rewriter = new ExceptionRewriter(); }