Some more tests

This commit is contained in:
Tyrrrz
2021-09-15 00:33:53 +03:00
parent 402b5cc7d0
commit af11064a85
12 changed files with 513 additions and 101 deletions

View File

@@ -0,0 +1,24 @@
using System.IO;
namespace DiscordChatExporter.Cli.Tests.Utils
{
internal static class DirectoryEx
{
public static void DeleteIfExists(string dirPath, bool recursive = true)
{
try
{
Directory.Delete(dirPath, recursive);
}
catch (DirectoryNotFoundException)
{
}
}
public static void Reset(string dirPath)
{
DeleteIfExists(dirPath);
Directory.CreateDirectory(dirPath);
}
}
}