[mono/tests] Fix out of tree build.
[mono-project.git] / mcs / tests / gtest-anontype-04.cs
blob8d37e4782da3309cf0f059be293d8a371212da9a
2 // Tests anonymous types initialized with a mix of literals, local variables and object members
3 using System;
4 using System.Collections;
6 public class MyClass
8 public string Foo = "Bar";
9 public int Baz {
10 get { return 16; }
14 public class Test
16 public static int Main ()
18 string Hello = "World";
19 MyClass mc = new MyClass();
20 var v = new { mc.Foo, mc.Baz, Hello, Answer = 42 };
22 if (v.Foo != "Bar")
23 return 1;
24 if (v.Baz != 16)
25 return 2;
26 if (v.Hello != "World")
27 return 3;
28 if (v.Answer != 42)
29 return 4;
31 return 0;