using System; using System.IO; /** * This tests the System.IO.Path class. */ public class PathTest { static void show (String method, String arg, String call) { Console.WriteLine("Path.{0}(\"{1}\") = \"{2}\"",method,arg,call); } public static void Main () { PathTest.show("GetExtension","Foo",Path.GetExtension("Foo")); String path = "PathTest.cs"; PathTest.show("GetExtension",path,Path.GetExtension(path)); PathTest.show("GetFullPath",path,Path.GetFullPath(path)); path = Path.GetFullPath(path); PathTest.show("GetFileName",path,Path.GetFileName(path)); PathTest.show("GetDirectoryName",path,Path.GetDirectoryName(path)); PathTest.show("GetPathRoot",path,Path.GetPathRoot(path)); } }