'--------------------------------------------------------------------
' Test case of Path Class
'--------------------------------------------------------------------

Namespace PathTest

Imports System.IO

Sub TestMain()
	Dim testPath = New String("C:\Dir.Name\file.name.ext")

	UnitTest("Path.GetFileName", Path.GetFileName(testPath) = "file.name.ext")

	UnitTest("Path.GetFileNameWithoutExtension", Path.GetFileNameWithoutExtension(testPath) = "file.name")


	UnitTest("Path.GetExtension", Path.GetExtension(testPath) = ".ext")

	UnitTest("Path.ChangeExtension", Path.ChangeExtension(testPath, ".newExt") = "C:\Dir.Name\file.name.newExt")

	UnitTest("Path.HasExtension (Case1)", Path.HasExtension(testPath) = True)
	UnitTest("Path.HasExtension (Case2)", Path.HasExtension("fileName") = False)

	UnitTest("Path.GetPathRoot", Path.GetPathRoot(testPath) = "C:\")

	UnitTest("Path.IsPathRooted (Case1)", Path.IsPathRooted(testPath) = True)
	UnitTest("Path.IsPathRooted (Case2)", Path.IsPathRooted("Dir.Name\file.name.ext") = False)

	UnitTest("Path.Combine (Case1)", Path.Combine("C:\dir", "filename.txt") = "C:\dir\filename.txt")
	UnitTest("Path.Combine (Case2)", Path.Combine("C:\dir\", "filename.txt") = "C:\dir\filename.txt")

/*
	テストしていないメソッド
	GetRandomFileName
	GetTempFileName
	GetTempPath
	GetFullPath
*/
End Sub

End Namespace

PathTest.TestMain()
