mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-27 22:12:25 +00:00
commit
6c8023ff5e
1 changed files with 23 additions and 17 deletions
|
|
@ -496,7 +496,16 @@ namespace Cosmos.Kernel.Tests.Fat
|
|||
var xDirectory = Directory.CreateDirectory(@"0:\test2");
|
||||
Assert.IsTrue(xDirectory != null, "Directory.CreateDirectory failed: Directory is null");
|
||||
bool xExists = Directory.Exists(@"0:\test2");
|
||||
Assert.IsTrue(xExists, "Directory.CreateDirectory failed: Directory is doesn't exist after create call");
|
||||
Assert.IsTrue(xExists, "Directory.CreateDirectory failed: Directory doesn't exist after create call");
|
||||
mDebugger.Send("END TEST");
|
||||
|
||||
mDebugger.Send("");
|
||||
|
||||
mDebugger.Send("START TEST: Delete a directory:");
|
||||
Directory.CreateDirectory(@"0:\Test1");
|
||||
Assert.IsTrue(Directory.Exists(@"0:\TestDir1"), "TestDir1 wasn't created!");
|
||||
Directory.Delete(@"0:\TestDir1");
|
||||
Assert.IsFalse(Directory.Exists(@"0:\TestDir1"), "TestDir1 wasn't deleted!");
|
||||
mDebugger.Send("END TEST");
|
||||
|
||||
mDebugger.Send("");
|
||||
|
|
@ -511,7 +520,6 @@ namespace Cosmos.Kernel.Tests.Fat
|
|||
/// </summary>
|
||||
private void TestFile()
|
||||
{
|
||||
/*
|
||||
string xContents;
|
||||
// Moved this test here because if not the test can be executed only a time!
|
||||
mDebugger.Send("Write to file now");
|
||||
|
|
@ -683,24 +691,22 @@ namespace Cosmos.Kernel.Tests.Fat
|
|||
// "Contents of Kudzu.txt was appended incorrectly!");
|
||||
//mDebugger.Send("END TEST");
|
||||
//mDebugger.Send("");
|
||||
*/
|
||||
|
||||
Assert.IsTrue(File.Exists("0:\\Kudzu.txt"), "Kudzu.txt wasn't found!");
|
||||
File.Delete(@"0:\Kudzu.txt");
|
||||
Assert.IsFalse(File.Exists("0:\\Kudzu.txt"), "Kudzu.txt wasn't deleted!");
|
||||
mDebugger.Send("START TEST: Delete a file:");
|
||||
File.Create(@"0:\test1.txt");
|
||||
Assert.IsTrue(File.Exists(@"0:\test1.txt"), "test1.txt wasn't created!");
|
||||
File.Delete(@"0:\test1.txt");
|
||||
Assert.IsFalse(File.Exists(@"0:\test1.txt"), "test1.txt wasn't deleted!");
|
||||
mDebugger.Send("END TEST");
|
||||
|
||||
//mDebugger.Send("START TEST: Delete a directory with File.Delete:");
|
||||
//Simple test: create a directory, then try to delete it as a file.
|
||||
Directory.CreateDirectory(@"0:\KillMe");
|
||||
try
|
||||
{
|
||||
File.Delete("0:\\KillMe");
|
||||
Assert.IsTrue(false, "Somehow, File.Delete on a directory either works like Directory.Delete, or it's just not throwing the exception.");
|
||||
Assert.IsTrue(Directory.Exists("0:\\KillMe"), "Yeah, it's actually deleting the directory. That isn't right.");
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
}
|
||||
//Directory.CreateDirectory(@"0:\Dir1");
|
||||
|
||||
//File.Delete(@"0:\Dir1");
|
||||
//Assert.IsTrue(Directory.Exists(@"0:\Dir1"), "Yeah, it's actually deleting the directory. That isn't right.");
|
||||
|
||||
//mDebugger.Send("END TEST");
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
|
|
|||
Loading…
Reference in a new issue