2004-09-23 Zoltan Varga <vargaz@freemail.hu>
[mono.git] / mcs / btests / VariablesD.vb
1 Imports System
2 Class A
3         public shared y as integer = 20
4         public z as integer = 30
5
6         Shared Sub New()
7         End Sub
8
9         public Sub New()
10         End Sub
11
12         Shared function f() as integer
13                 return 50
14         end function
15 end class
16
17 Module M
18         Sub Main()
19                 if (A.y <> 20) then
20                         Throw new Exception ("#A1, Unexpected result")
21                 end if
22
23                 dim c as new A()
24                 dim d as new A()
25
26                 if(c.y <> 20) then
27                         Throw new Exception ("#A2, Unexpected result")
28                 end if
29
30                 if(d.y <> 20) then
31                         Throw new Exception ("#A3, Unexpected result")
32                 end if
33
34                 A.y = 25
35
36                 if(c.y <> 25) then
37                         Throw new Exception ("#A4, Unexpected result")
38                 end if
39
40                 c.y = 35
41
42                 if(A.y <> 35) then
43                         Throw new Exception ("#A5, Unexpected result")
44                 end if
45
46                 if(d.y <> 35) then
47                         Throw new Exception ("#A6, Unexpected result")
48                 end if
49
50
51                 if(c.z <> 30) then
52                         Throw new Exception ("#A7, Unexpected result")
53                 end if
54
55                 if(A.f() <> 50) then
56                         Throw new Exception ("#A8, Unexpected result")
57                 end if
58         End Sub
59 End Module