3 namespace InternalsVisibleTo {
5 static void Main (string[] args) {
8 Console.WriteLine("-- Correct case --");
11 var a = new CorrectCaseFriendAssembly.InternalClass(@internal: 0);
12 Console.WriteLine("Access internal class internal ctor: OK");
13 } catch (MemberAccessException) {
15 Console.WriteLine("Access friend internal ctor: Fail");
18 Console.WriteLine("-- Wrong case --");
21 var a = new WrongCaseFriendAssembly.InternalClass(@internal: 0);
22 Console.WriteLine("Access internal class internal ctor: OK");
23 } catch (MemberAccessException) {
25 Console.WriteLine("Access friend internal ctor: Fail");
29 // This also works in the Windows CLR. Huh.
30 WrongCaseFriendAssembly.InternalClass.PrivateStaticMethod();
31 Console.WriteLine("Access friend private static method: OK");
32 } catch (MemberAccessException) {
33 Console.WriteLine("Access friend private static method: Fail");
38 WrongCaseFriendAssembly.InternalClass.InternalStaticMethod();
39 Console.WriteLine("Access friend internal static method: OK");
40 } catch (MemberAccessException) {
42 Console.WriteLine("Access friend internal static method: Fail");
46 WrongCaseFriendAssembly.PublicClass.InternalStaticMethod();
47 Console.WriteLine("Access public internal static method: OK");
48 } catch (MemberAccessException) {
50 Console.WriteLine("Access public internal static method: Fail");
53 if (System.Diagnostics.Debugger.IsAttached)
56 Console.WriteLine("Incorrect results: {0}", failCount);
57 Environment.ExitCode = failCount;