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

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

UTF8Encoding(仮)の追加

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 UnitTest("Path.GetFileName", Path.GetFileName(testPath) = "file.name.ext")
12
13 UnitTest("Path.GetFileNameWithoutExtension", Path.GetFileNameWithoutExtension(testPath) = "file.name")
14
15
16 UnitTest("Path.GetExtension", Path.GetExtension(testPath) = ".ext")
17
18 UnitTest("Path.ChangeExtension", Path.ChangeExtension(testPath, ".newExt") = "C:\Dir.Name\file.name.newExt")
19
20 UnitTest("Path.HasExtension (Case1)", Path.HasExtension(testPath) = True)
21 UnitTest("Path.HasExtension (Case2)", Path.HasExtension("fileName") = False)
22
23 UnitTest("Path.GetPathRoot", Path.GetPathRoot(testPath) = "C:\")
24
25 UnitTest("Path.IsPathRooted (Case1)", Path.IsPathRooted(testPath) = True)
26 UnitTest("Path.IsPathRooted (Case2)", Path.IsPathRooted("Dir.Name\file.name.ext") = False)
27
28 UnitTest("Path.Combine (Case1)", Path.Combine("C:\dir", "filename.txt") = "C:\dir\filename.txt")
29 UnitTest("Path.Combine (Case2)", Path.Combine("C:\dir\", "filename.txt") = "C:\dir\filename.txt")
30
31/*
32 テストしていないメソッド
33 GetRandomFileName
34 GetTempFileName
35 GetTempPath
36 GetFullPath
37*/
38End Sub
39
40End Namespace
41
42PathTest.TestMain()
Note: See TracBrowser for help on using the repository browser.