mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-07-16 02:22:52 +01:00
Slight improvement to directory deletion test
This commit is contained in:
@@ -20,13 +20,17 @@ namespace Tgstation.Server.Host.IO.Tests
|
||||
Directory.CreateDirectory(tempPath);
|
||||
try
|
||||
{
|
||||
await File.WriteAllTextAsync(Path.Combine(tempPath, "file.txt"), "asdf");
|
||||
var subDir = Path.Combine(tempPath, "subdir");
|
||||
Directory.CreateDirectory(subDir);
|
||||
await File.WriteAllTextAsync(Path.Combine(subDir, "file2.txt"), "fdsa");
|
||||
await ioManager.DeleteDirectory(tempPath, default);
|
||||
|
||||
Assert.IsFalse(Directory.Exists(tempPath));
|
||||
}
|
||||
catch
|
||||
{
|
||||
Directory.Delete(tempPath);
|
||||
Directory.Delete(tempPath, true);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user