mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-20 12:58:39 +00:00
Small VFS changes Beginnings of DirectoryInfo.FullName implementation using base class FileSystemInfo
47 lines
1.7 KiB
C#
47 lines
1.7 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.IO;
|
|
|
|
namespace FrodeTest.Test
|
|
{
|
|
public class DirectoryInfoTest
|
|
{
|
|
public static void RunTest()
|
|
{
|
|
Console.WriteLine("Running DirectoryInfoTest");
|
|
|
|
Check.Text = "ctor";
|
|
DirectoryInfo dir = new DirectoryInfo("/0/lost+found/");
|
|
Check.Validate(dir != null);
|
|
Check.Validate(dir.Name == "lost+found");
|
|
Check.Validate(dir.FullName == "/0/lost+found/");
|
|
Console.WriteLine("Fullname: " + dir.FullName);
|
|
Check.Text = "Exists for /0/lost+found/";
|
|
Check.Validate(dir.Exists);
|
|
|
|
DirectoryInfo dir2 = new DirectoryInfo("/0/Alfa/Bravo/");
|
|
Console.WriteLine("Dir2: " + dir2.FullName);
|
|
Console.WriteLine("Dir : " + dir.FullName);
|
|
Check.Text = "Exists for /0/Alfa/Bravo/";
|
|
Check.Validate(dir2.Exists);
|
|
Check.Text = "GetFiles for /0/Alfa/Bravo/";
|
|
Check.Validate(dir2.GetFiles().Length == 1);
|
|
Console.WriteLine("Files in the directory:");
|
|
foreach (FileInfo file in dir2.GetFiles())
|
|
Console.WriteLine(file.Name);
|
|
|
|
dir = new DirectoryInfo("/0/");
|
|
Check.Text = "Exists for /0/";
|
|
Check.Validate(dir.Exists);
|
|
Check.Text = "GetFiles for /0/";
|
|
Check.Validate(dir.GetFiles().Length == 3);
|
|
Console.WriteLine("Files in the directory:");
|
|
foreach (FileInfo file in dir.GetFiles())
|
|
Console.WriteLine(file.Name);
|
|
|
|
|
|
}
|
|
}
|
|
}
|