3 class Test<T> where T :Exception {
5 public void test_catch () {
7 throw new RankException ();
15 delegate void Action();
16 static void ExpectedException<T>(Action action) where T: Exception
20 Console.WriteLine("Expected Exception: " + typeof(T).FullName);
24 public static void Main()
26 ExpectedException<DivideByZeroException>(delegate() { throw new DivideByZeroException(); });
27 Test<RankException> t = new Test<RankException> ();