[TestClass] public class Foo { public static void Bar() { } [TestCleanup] public void TestCleanup() { MockManager.ClearAll(); } [TestInitialize] public void TestInitialize() { MockManager.Init(); } [TestMethod] public void SimpleCode_RunIt_StackOverflowException() { using (RecordExpectations recorder = new RecordExpectations()) { Foo.Bar(); recorder.Throw( new SoapException()); } } }