source: trunk/TestCase/SimpleTestCase/ExceptionTest.ab@ 451

Last change on this file since 451 was 432, checked in by イグトランス (egtra), 17 years ago

StreamReaderの完成。StringReaderの追加。
Consoleの追加(現在入力関係の一部のみ)。

File size: 828 bytes
Line 
1Namespace ExceptionTest
2
3Sub BadProc()
4 Throw New System.SystemException("hello! I am bad proc.")
5End Sub
6
7Sub TestMain()
8 Dim resultOfTest1 = False As Boolean
9 Dim resultOfTest2 = False As Boolean
10 Dim resultOfTest3 = False As Boolean
11 Try
12 Try
13 BadProc()
14 Finally
15 resultOfTest1 = True
16 End Try
17 Catch msg As System.Exception
18 ' msgの受け渡しが未完成
19 If msg.Message = "hello! I am bad proc." Then
20 resultOfTest2 = True
21 End If
22 Catch
23 System.Diagnostics.Trace.WriteLine( "Catchが実行された。ここに来るのは正しくない" )
24 UnitTest( "到達しないコードへ到達", False)
25 Finally
26 resultOfTest3 = True
27 End Try
28
29 UnitTest( "Exception1", resultOfTest1 )
30 UnitTest( "Exception2", resultOfTest2 )
31 UnitTest( "Exception3", resultOfTest3 )
32End Sub
33
34End Namespace
35ExceptionTest.TestMain()
Note: See TracBrowser for help on using the repository browser.