Last change
on this file since 293 was 271, checked in by dai, 18 years ago |
SHFILEOPSTRUCT.hWnd → SHFILEOPSTRUCT.hwnd
System.IOに属するクラスに名前空間を適用した。
|
File size:
1.4 KB
|
Rev | Line | |
---|
[254] | 1 | '--------------------------------------------------------------------
|
---|
| 2 | ' Test case of Path Class
|
---|
| 3 | '--------------------------------------------------------------------
|
---|
| 4 | #require <Classes\System\IO\Path.ab>
|
---|
| 5 |
|
---|
| 6 | Namespace PathTest
|
---|
| 7 |
|
---|
[271] | 8 | Imports System.IO
|
---|
| 9 |
|
---|
[254] | 10 | Sub TestMain()
|
---|
| 11 | Dim testPath = New String("C:\Dir.Name\file.name.ext")
|
---|
| 12 |
|
---|
| 13 | UnitTest("Path.GetFileName", Path.GetFileName(testPath) = "file.name.ext")
|
---|
| 14 |
|
---|
| 15 | UnitTest("Path.GetFileNameWithoutExtension", Path.GetFileNameWithoutExtension(testPath) = "file.name")
|
---|
| 16 |
|
---|
| 17 |
|
---|
| 18 | UnitTest("Path.GetExtension", Path.GetExtension(testPath) = ".ext")
|
---|
| 19 |
|
---|
| 20 | UnitTest("Path.ChangeExtension", Path.ChangeExtension(testPath, ".newExt") = "C:\Dir.Name\file.name.newExt")
|
---|
| 21 |
|
---|
| 22 | UnitTest("Path.HasExtension (Case1)", Path.HasExtension(testPath) = True)
|
---|
| 23 | UnitTest("Path.HasExtension (Case2)", Path.HasExtension("fileName") = False)
|
---|
| 24 |
|
---|
| 25 | UnitTest("Path.GetPathRoot", Path.GetPathRoot(testPath) = "C:\")
|
---|
| 26 |
|
---|
| 27 | UnitTest("Path.IsPathRooted (Case1)", Path.IsPathRooted(testPath) = True)
|
---|
| 28 | UnitTest("Path.IsPathRooted (Case2)", Path.IsPathRooted("Dir.Name\file.name.ext") = False)
|
---|
| 29 |
|
---|
| 30 | UnitTest("Path.Combine (Case1)", Path.Combine("C:\dir", "filename.txt") = "C:\dir\filename.txt")
|
---|
| 31 | UnitTest("Path.Combine (Case2)", Path.Combine("C:\dir\", "filename.txt") = "C:\dir\filename.txt")
|
---|
| 32 |
|
---|
| 33 | /*
|
---|
| 34 | テストしていないメソッド
|
---|
| 35 | GetRandomFileName
|
---|
| 36 | GetTempFileName
|
---|
| 37 | GetTempPath
|
---|
| 38 | GetFullPath
|
---|
| 39 | */
|
---|
| 40 | End Sub
|
---|
| 41 |
|
---|
| 42 | End Namespace
|
---|
| 43 |
|
---|
| 44 | PathTest.TestMain()
|
---|
Note:
See
TracBrowser
for help on using the repository browser.