public static int Main(string[] args) { //Start recording testLog.StartRecording(); try { MiddleMethod(); } catch { Console.WriteLine("Pass"); } // stop recoding testLog.StopRecording(); return(testLog.VerifyOutput()); }
public static int Main() { //Start recording testLog.StartRecording(); try { Console.WriteLine("In main try..."); } finally { Console.WriteLine("In main finally..."); try { Console.WriteLine("In inner try 1..."); try { Console.WriteLine("In inner try 2..."); goto LABEL; } catch { Console.WriteLine("Will never see this catch..."); } Console.WriteLine("Will never see this code, jumping over it!"); LABEL: Console.WriteLine("Back in inner try 1..."); } finally { Console.WriteLine("Now in inner finally..."); } } // stop recoding testLog.StopRecording(); return(testLog.VerifyOutput()); }
public static int Main(string[] args) { //Start recording testLog.StartRecording(); try { Console.WriteLine("Main: In Try"); MiddleMethod(); } catch { Console.WriteLine("Main: Caught the exception"); } // stop recoding testLog.StopRecording(); return(testLog.VerifyOutput()); }
static public int Main(string[] args) { // start recording testLog.StartRecording(); int i = Environment.TickCount != 0 ? 0 : 1; try { Console.WriteLine("in main try"); Middle1(i); } catch { Console.WriteLine("in main catch"); } // stop recoding testLog.StopRecording(); return(testLog.VerifyOutput()); }
static int Main() { //Start recording testLog.StartRecording(); try { byte[] arr = new byte[] { 1, 2, 3, 4, 5 }; WriteLocations(arr); } catch { Console.WriteLine("In catch, Unreached\n"); goto done; } Console.WriteLine("After try"); done: Console.WriteLine("Done"); // stop recoding testLog.StopRecording(); return(testLog.VerifyOutput()); }
public static int TestEntryPoint() { //Start recording testLog.StartRecording(); Console.WriteLine("Begin test..."); try { Console.WriteLine("In main try"); throw new Exception(); } catch { Console.WriteLine("In main catch"); try { Console.WriteLine("In inner try"); goto L; } catch { Console.WriteLine("In inner catch"); } } Console.WriteLine("DEAD CODE!"); L: Console.WriteLine("End test..."); // stop recoding testLog.StopRecording(); return(testLog.VerifyOutput()); }