This commit is contained in:
Tyrrrz
2021-12-08 23:50:21 +02:00
parent 8e7baee8a5
commit 880f400e2c
148 changed files with 14241 additions and 14396 deletions

View File

@@ -1,24 +1,23 @@
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)
{
}
}
namespace DiscordChatExporter.Cli.Tests.Utils;
public static void Reset(string dirPath)
internal static class DirectoryEx
{
public static void DeleteIfExists(string dirPath, bool recursive = true)
{
try
{
Directory.Delete(dirPath, recursive);
}
catch (DirectoryNotFoundException)
{
DeleteIfExists(dirPath);
Directory.CreateDirectory(dirPath);
}
}
public static void Reset(string dirPath)
{
DeleteIfExists(dirPath);
Directory.CreateDirectory(dirPath);
}
}

View File

@@ -1,12 +1,11 @@
using AngleSharp.Html.Dom;
using AngleSharp.Html.Parser;
namespace DiscordChatExporter.Cli.Tests.Utils
{
internal static class Html
{
private static readonly IHtmlParser Parser = new HtmlParser();
namespace DiscordChatExporter.Cli.Tests.Utils;
public static IHtmlDocument Parse(string source) => Parser.ParseDocument(source);
}
internal static class Html
{
private static readonly IHtmlParser Parser = new HtmlParser();
public static IHtmlDocument Parse(string source) => Parser.ParseDocument(source);
}