Last change
on this file since 451 was 432, checked in by イグトランス (egtra), 17 years ago |
StreamReaderの完成。StringReaderの追加。
Consoleの追加(現在入力関係の一部のみ)。
|
File size:
828 bytes
|
Rev | Line | |
---|
[375] | 1 | Namespace ExceptionTest
|
---|
| 2 |
|
---|
| 3 | Sub BadProc()
|
---|
[388] | 4 | Throw New System.SystemException("hello! I am bad proc.")
|
---|
[375] | 5 | End Sub
|
---|
| 6 |
|
---|
| 7 | Sub 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
|
---|
[385] | 17 | Catch msg As System.Exception
|
---|
[375] | 18 | ' msgの受け渡しが未完成
|
---|
[385] | 19 | If msg.Message = "hello! I am bad proc." Then
|
---|
[375] | 20 | resultOfTest2 = True
|
---|
| 21 | End If
|
---|
| 22 | Catch
|
---|
| 23 | System.Diagnostics.Trace.WriteLine( "Catchが実行された。ここに来るのは正しくない" )
|
---|
[385] | 24 | UnitTest( "到達しないコードへ到達", False)
|
---|
[375] | 25 | Finally
|
---|
| 26 | resultOfTest3 = True
|
---|
| 27 | End Try
|
---|
| 28 |
|
---|
| 29 | UnitTest( "Exception1", resultOfTest1 )
|
---|
| 30 | UnitTest( "Exception2", resultOfTest2 )
|
---|
| 31 | UnitTest( "Exception3", resultOfTest3 )
|
---|
| 32 | End Sub
|
---|
| 33 |
|
---|
| 34 | End Namespace
|
---|
| 35 | ExceptionTest.TestMain()
|
---|
Note:
See
TracBrowser
for help on using the repository browser.