source: trunk/TestCase/SimpleTestCase/PathTest.ab@ 359

Last change on this file since 359 was 299, checked in by dai, 17 years ago

【32bitコンパイラ】
静的リンクライブラリを実装
ジェネリクスを実装
※64bitコンパイラは未実装

File size: 1.4 KB
Line 
1'--------------------------------------------------------------------
2' Test case of Path Class
3'--------------------------------------------------------------------
4
5Namespace PathTest
6
7Imports System.IO
8
9Sub TestMain()
10 Dim testPath = New String("C:\Dir.Name\file.name.ext")
11
12 UnitTest("Path.GetFileName", Path.GetFileName(testPath) = "file.name.ext")
13
14 UnitTest("Path.GetFileNameWithoutExtension", Path.GetFileNameWithoutExtension(testPath) = "file.name")
15
16
17 UnitTest("Path.GetExtension", Path.GetExtension(testPath) = ".ext")
18
19 UnitTest("Path.ChangeExtension", Path.ChangeExtension(testPath, ".newExt") = "C:\Dir.Name\file.name.newExt")
20
21 UnitTest("Path.HasExtension (Case1)", Path.HasExtension(testPath) = True)
22 UnitTest("Path.HasExtension (Case2)", Path.HasExtension("fileName") = False)
23
24 UnitTest("Path.GetPathRoot", Path.GetPathRoot(testPath) = "C:\")
25
26 UnitTest("Path.IsPathRooted (Case1)", Path.IsPathRooted(testPath) = True)
27 UnitTest("Path.IsPathRooted (Case2)", Path.IsPathRooted("Dir.Name\file.name.ext") = False)
28
29 UnitTest("Path.Combine (Case1)", Path.Combine("C:\dir", "filename.txt") = "C:\dir\filename.txt")
30 UnitTest("Path.Combine (Case2)", Path.Combine("C:\dir\", "filename.txt") = "C:\dir\filename.txt")
31
32/*
33 テストしていないメソッド
34 GetRandomFileName
35 GetTempFileName
36 GetTempPath
37 GetFullPath
38*/
39End Sub
40
41End Namespace
42
43PathTest.TestMain()
Note: See TracBrowser for help on using the repository browser.