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

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

Stringなどで例外を投げるようにした。
#147の解決。
CType ASCII文字判定関数群の追加。

File size: 830 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
35
36ExceptionTest.TestMain()
Note: See TracBrowser for help on using the repository browser.