public void ExecuteSubFunction_WithFailedRedirect() { using (MockRepository.Ordered()) { ResponseMock.Expect(mock => mock.Redirect("/resumeUrl.wxe")); } MockRepository.ReplayAll(); _executionState.ExecuteSubFunction(WxeContext); }
public void ExecuteSubFunction() { using (MockRepository.Ordered()) { ResponseMock.Expect(mock => mock.Redirect("/resumeUrl.wxe")).WhenCalled(invocation => Thread.CurrentThread.Abort()); ExecutionStateContextMock.Expect(mock => mock.SetExecutionState(Arg <PostProcessingSubFunctionState> .Is.NotNull)) .WhenCalled(invocation => CheckExecutionState((PostProcessingSubFunctionState)invocation.Arguments[0])); } MockRepository.ReplayAll(); try { _executionState.ExecuteSubFunction(WxeContext); Assert.Fail(); } catch (ThreadAbortException) { Thread.ResetAbort(); } MockRepository.VerifyAll(); }