Namespace ExceptionTest

Sub BadProc()
	Throw New System.SystemException("hello! I am bad proc.")
End Sub

Sub TestMain()
	Dim resultOfTest1 = False As Boolean
	Dim resultOfTest2 = False As Boolean
	Dim resultOfTest3 = False As Boolean
	Try
		Try
			BadProc()
		Finally
			resultOfTest1 = True
		End Try
	Catch msg As System.Exception
		' msgの受け渡しが未完成
		If msg.Message = "hello! I am bad proc." Then
			resultOfTest2 = True
		End If
	Catch
		System.Diagnostics.Trace.WriteLine( "Catchが実行された。ここに来るのは正しくない" )
		UnitTest( "到達しないコードへ到達", False)
	Finally
		resultOfTest3 = True
	End Try

	UnitTest( "Exception1", resultOfTest1 )
	UnitTest( "Exception2", resultOfTest2 )
	UnitTest( "Exception3", resultOfTest3 )
End Sub

End Namespace
ExceptionTest.TestMain()
