New test.
[mono.git] / mono / tests / cas / linkdemand / aptc1.cs
1 using System;
2 using System.Security;
3 using System.Security.Permissions;
4
5 #if RESTRICT
6 // this ensure we don't have FullTrust
7 [assembly: SecurityPermission (SecurityAction.RequestRefuse, SkipVerification = true)]
8 #endif
9
10 public class Program {
11
12         static int Main ()
13         {
14                 try {
15                         // mscorlib is strongnamed and has [AllowPartiallyTrustedCallers]
16                         // so this call will work even if this assembly isn't strongnamed
17                         Console.WriteLine ("*0* Hellp World");
18                         return 0;
19                 }
20                 catch (SecurityException se) {
21                         Console.WriteLine ("*1* Expected SecurityException\n{0}", se);
22                         return 1;
23                 }
24                 catch (Exception e) {
25                         Console.WriteLine ("*2* Unexpected exception\n{0}", e);
26                         return 2;
27                 }
28         }
29 }