**** Merged from MCS ****
[mono-project.git] / mcs / mbas / Test / tests / ConditionalCompilationA.vb
blob66c4689f681eccdd9a52d5e10ff977be9a48d7d1
1 Imports System
2 Module ConditionalCompilation
3 Sub Main()
4 Dim value As Integer
5 Try
6 'Testing #If and #End If Block - Variation 1
8 #If True
9 value=10
10 #End If
11 If value<>10 Then
12 Throw New Exception("#A11-Conditional Compilation:Failed ")
13 End If
14 Catch e As Exception
15 Console.WriteLine(e.Message)
16 End Try
18 Try
19 'Testing #If and #End If Block - Variation 2
20 #If False
21 Throw New Exception("#A21-Conditional Compilation:Failed")
22 #End If
23 Catch e As Exception
24 Console.WriteLine(e.Message)
25 End Try
27 Try
28 'Testing #If, #Else and #End If Block - Variation 3
29 #If True
30 value=30
31 #Else
32 Throw New Exception("#A31-Conditional Compilation:Failed")
33 #End If
35 If value<>30
36 Throw New Exception("#A32-Conditional Compilation:Failed")
37 End If
38 Catch e As Exception
39 Console.WriteLine(e.Message)
40 End Try
42 Try
43 'Testing #If, #Else and #End If Block - Variation 4
44 #If False
45 Throw New Exception("#A41-Conditional Compilation:Failed")
46 #Else
47 value=40
48 #End If
50 If value<>40
51 Throw New Exception("#A42-Conditional Compilation:Failed")
52 End If
53 Catch e As Exception
54 Console.WriteLine(e.Message)
55 End Try
57 End Sub
58 End Module