|
|
@ -36,16 +36,20 @@ namespace DiscordChatExporter.Cli.Tests
|
|
|
|
var outputFilePath = Path.ChangeExtension(_tempOutput.GetTempFilePath(), "json");
|
|
|
|
var outputFilePath = Path.ChangeExtension(_tempOutput.GetTempFilePath(), "json");
|
|
|
|
|
|
|
|
|
|
|
|
// Act
|
|
|
|
// Act
|
|
|
|
await new ExportChannelsCommand
|
|
|
|
var jsonData = await GlobalCache.WrapAsync("mention-specs-output-json", async () =>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TokenValue = Secrets.DiscordToken,
|
|
|
|
await new ExportChannelsCommand
|
|
|
|
IsBotToken = Secrets.IsDiscordTokenBot,
|
|
|
|
{
|
|
|
|
ChannelIds = new[] {Snowflake.Parse(ChannelIds.MentionTestCases)},
|
|
|
|
TokenValue = Secrets.DiscordToken,
|
|
|
|
ExportFormat = ExportFormat.Json,
|
|
|
|
IsBotToken = Secrets.IsDiscordTokenBot,
|
|
|
|
OutputPath = outputFilePath
|
|
|
|
ChannelIds = new[] {Snowflake.Parse(ChannelIds.MentionTestCases)},
|
|
|
|
}.ExecuteAsync(new FakeConsole());
|
|
|
|
ExportFormat = ExportFormat.Json,
|
|
|
|
|
|
|
|
OutputPath = outputFilePath
|
|
|
|
var jsonData = await File.ReadAllTextAsync(outputFilePath);
|
|
|
|
}.ExecuteAsync(new FakeConsole());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return await File.ReadAllTextAsync(outputFilePath);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
_testOutput.WriteLine(jsonData);
|
|
|
|
_testOutput.WriteLine(jsonData);
|
|
|
|
|
|
|
|
|
|
|
|
var json = Json.Parse(jsonData);
|
|
|
|
var json = Json.Parse(jsonData);
|
|
|
@ -81,16 +85,20 @@ namespace DiscordChatExporter.Cli.Tests
|
|
|
|
var outputFilePath = Path.ChangeExtension(_tempOutput.GetTempFilePath(), "html");
|
|
|
|
var outputFilePath = Path.ChangeExtension(_tempOutput.GetTempFilePath(), "html");
|
|
|
|
|
|
|
|
|
|
|
|
// Act
|
|
|
|
// Act
|
|
|
|
await new ExportChannelsCommand
|
|
|
|
var htmlData = await GlobalCache.WrapAsync("mention-specs-output-html", async () =>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TokenValue = Secrets.DiscordToken,
|
|
|
|
await new ExportChannelsCommand
|
|
|
|
IsBotToken = Secrets.IsDiscordTokenBot,
|
|
|
|
{
|
|
|
|
ChannelIds = new[] {Snowflake.Parse(ChannelIds.MentionTestCases)},
|
|
|
|
TokenValue = Secrets.DiscordToken,
|
|
|
|
ExportFormat = ExportFormat.HtmlDark,
|
|
|
|
IsBotToken = Secrets.IsDiscordTokenBot,
|
|
|
|
OutputPath = outputFilePath
|
|
|
|
ChannelIds = new[] {Snowflake.Parse(ChannelIds.MentionTestCases)},
|
|
|
|
}.ExecuteAsync(new FakeConsole());
|
|
|
|
ExportFormat = ExportFormat.HtmlDark,
|
|
|
|
|
|
|
|
OutputPath = outputFilePath
|
|
|
|
var htmlData = await File.ReadAllTextAsync(outputFilePath);
|
|
|
|
}.ExecuteAsync(new FakeConsole());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return await File.ReadAllTextAsync(outputFilePath);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
_testOutput.WriteLine(htmlData);
|
|
|
|
_testOutput.WriteLine(htmlData);
|
|
|
|
|
|
|
|
|
|
|
|
var html = Html.Parse(htmlData);
|
|
|
|
var html = Html.Parse(htmlData);
|
|
|
@ -110,16 +118,20 @@ namespace DiscordChatExporter.Cli.Tests
|
|
|
|
var outputFilePath = Path.ChangeExtension(_tempOutput.GetTempFilePath(), "json");
|
|
|
|
var outputFilePath = Path.ChangeExtension(_tempOutput.GetTempFilePath(), "json");
|
|
|
|
|
|
|
|
|
|
|
|
// Act
|
|
|
|
// Act
|
|
|
|
await new ExportChannelsCommand
|
|
|
|
var jsonData = await GlobalCache.WrapAsync("mention-specs-output-json", async () =>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TokenValue = Secrets.DiscordToken,
|
|
|
|
await new ExportChannelsCommand
|
|
|
|
IsBotToken = Secrets.IsDiscordTokenBot,
|
|
|
|
{
|
|
|
|
ChannelIds = new[] {Snowflake.Parse(ChannelIds.MentionTestCases)},
|
|
|
|
TokenValue = Secrets.DiscordToken,
|
|
|
|
ExportFormat = ExportFormat.Json,
|
|
|
|
IsBotToken = Secrets.IsDiscordTokenBot,
|
|
|
|
OutputPath = outputFilePath
|
|
|
|
ChannelIds = new[] {Snowflake.Parse(ChannelIds.MentionTestCases)},
|
|
|
|
}.ExecuteAsync(new FakeConsole());
|
|
|
|
ExportFormat = ExportFormat.Json,
|
|
|
|
|
|
|
|
OutputPath = outputFilePath
|
|
|
|
var jsonData = await File.ReadAllTextAsync(outputFilePath);
|
|
|
|
}.ExecuteAsync(new FakeConsole());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return await File.ReadAllTextAsync(outputFilePath);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
_testOutput.WriteLine(jsonData);
|
|
|
|
_testOutput.WriteLine(jsonData);
|
|
|
|
|
|
|
|
|
|
|
|
var json = Json.Parse(jsonData);
|
|
|
|
var json = Json.Parse(jsonData);
|
|
|
@ -148,16 +160,20 @@ namespace DiscordChatExporter.Cli.Tests
|
|
|
|
var outputFilePath = Path.ChangeExtension(_tempOutput.GetTempFilePath(), "html");
|
|
|
|
var outputFilePath = Path.ChangeExtension(_tempOutput.GetTempFilePath(), "html");
|
|
|
|
|
|
|
|
|
|
|
|
// Act
|
|
|
|
// Act
|
|
|
|
await new ExportChannelsCommand
|
|
|
|
var htmlData = await GlobalCache.WrapAsync("mention-specs-output-html", async () =>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TokenValue = Secrets.DiscordToken,
|
|
|
|
await new ExportChannelsCommand
|
|
|
|
IsBotToken = Secrets.IsDiscordTokenBot,
|
|
|
|
{
|
|
|
|
ChannelIds = new[] {Snowflake.Parse(ChannelIds.MentionTestCases)},
|
|
|
|
TokenValue = Secrets.DiscordToken,
|
|
|
|
ExportFormat = ExportFormat.HtmlDark,
|
|
|
|
IsBotToken = Secrets.IsDiscordTokenBot,
|
|
|
|
OutputPath = outputFilePath
|
|
|
|
ChannelIds = new[] {Snowflake.Parse(ChannelIds.MentionTestCases)},
|
|
|
|
}.ExecuteAsync(new FakeConsole());
|
|
|
|
ExportFormat = ExportFormat.HtmlDark,
|
|
|
|
|
|
|
|
OutputPath = outputFilePath
|
|
|
|
var htmlData = await File.ReadAllTextAsync(outputFilePath);
|
|
|
|
}.ExecuteAsync(new FakeConsole());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return await File.ReadAllTextAsync(outputFilePath);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
_testOutput.WriteLine(htmlData);
|
|
|
|
_testOutput.WriteLine(htmlData);
|
|
|
|
|
|
|
|
|
|
|
|
var html = Html.Parse(htmlData);
|
|
|
|
var html = Html.Parse(htmlData);
|
|
|
@ -176,16 +192,20 @@ namespace DiscordChatExporter.Cli.Tests
|
|
|
|
var outputFilePath = Path.ChangeExtension(_tempOutput.GetTempFilePath(), "json");
|
|
|
|
var outputFilePath = Path.ChangeExtension(_tempOutput.GetTempFilePath(), "json");
|
|
|
|
|
|
|
|
|
|
|
|
// Act
|
|
|
|
// Act
|
|
|
|
await new ExportChannelsCommand
|
|
|
|
var jsonData = await GlobalCache.WrapAsync("mention-specs-output-json", async () =>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TokenValue = Secrets.DiscordToken,
|
|
|
|
await new ExportChannelsCommand
|
|
|
|
IsBotToken = Secrets.IsDiscordTokenBot,
|
|
|
|
{
|
|
|
|
ChannelIds = new[] {Snowflake.Parse(ChannelIds.MentionTestCases)},
|
|
|
|
TokenValue = Secrets.DiscordToken,
|
|
|
|
ExportFormat = ExportFormat.Json,
|
|
|
|
IsBotToken = Secrets.IsDiscordTokenBot,
|
|
|
|
OutputPath = outputFilePath
|
|
|
|
ChannelIds = new[] {Snowflake.Parse(ChannelIds.MentionTestCases)},
|
|
|
|
}.ExecuteAsync(new FakeConsole());
|
|
|
|
ExportFormat = ExportFormat.Json,
|
|
|
|
|
|
|
|
OutputPath = outputFilePath
|
|
|
|
var jsonData = await File.ReadAllTextAsync(outputFilePath);
|
|
|
|
}.ExecuteAsync(new FakeConsole());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return await File.ReadAllTextAsync(outputFilePath);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
_testOutput.WriteLine(jsonData);
|
|
|
|
_testOutput.WriteLine(jsonData);
|
|
|
|
|
|
|
|
|
|
|
|
var json = Json.Parse(jsonData);
|
|
|
|
var json = Json.Parse(jsonData);
|
|
|
@ -214,16 +234,20 @@ namespace DiscordChatExporter.Cli.Tests
|
|
|
|
var outputFilePath = Path.ChangeExtension(_tempOutput.GetTempFilePath(), "html");
|
|
|
|
var outputFilePath = Path.ChangeExtension(_tempOutput.GetTempFilePath(), "html");
|
|
|
|
|
|
|
|
|
|
|
|
// Act
|
|
|
|
// Act
|
|
|
|
await new ExportChannelsCommand
|
|
|
|
var htmlData = await GlobalCache.WrapAsync("mention-specs-output-html", async () =>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TokenValue = Secrets.DiscordToken,
|
|
|
|
await new ExportChannelsCommand
|
|
|
|
IsBotToken = Secrets.IsDiscordTokenBot,
|
|
|
|
{
|
|
|
|
ChannelIds = new[] {Snowflake.Parse(ChannelIds.MentionTestCases)},
|
|
|
|
TokenValue = Secrets.DiscordToken,
|
|
|
|
ExportFormat = ExportFormat.HtmlDark,
|
|
|
|
IsBotToken = Secrets.IsDiscordTokenBot,
|
|
|
|
OutputPath = outputFilePath
|
|
|
|
ChannelIds = new[] {Snowflake.Parse(ChannelIds.MentionTestCases)},
|
|
|
|
}.ExecuteAsync(new FakeConsole());
|
|
|
|
ExportFormat = ExportFormat.HtmlDark,
|
|
|
|
|
|
|
|
OutputPath = outputFilePath
|
|
|
|
var htmlData = await File.ReadAllTextAsync(outputFilePath);
|
|
|
|
}.ExecuteAsync(new FakeConsole());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return await File.ReadAllTextAsync(outputFilePath);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
_testOutput.WriteLine(htmlData);
|
|
|
|
_testOutput.WriteLine(htmlData);
|
|
|
|
|
|
|
|
|
|
|
|
var html = Html.Parse(htmlData);
|
|
|
|
var html = Html.Parse(htmlData);
|
|
|
@ -242,16 +266,20 @@ namespace DiscordChatExporter.Cli.Tests
|
|
|
|
var outputFilePath = Path.ChangeExtension(_tempOutput.GetTempFilePath(), "json");
|
|
|
|
var outputFilePath = Path.ChangeExtension(_tempOutput.GetTempFilePath(), "json");
|
|
|
|
|
|
|
|
|
|
|
|
// Act
|
|
|
|
// Act
|
|
|
|
await new ExportChannelsCommand
|
|
|
|
var jsonData = await GlobalCache.WrapAsync("mention-specs-output-json", async () =>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TokenValue = Secrets.DiscordToken,
|
|
|
|
await new ExportChannelsCommand
|
|
|
|
IsBotToken = Secrets.IsDiscordTokenBot,
|
|
|
|
{
|
|
|
|
ChannelIds = new[] {Snowflake.Parse(ChannelIds.MentionTestCases)},
|
|
|
|
TokenValue = Secrets.DiscordToken,
|
|
|
|
ExportFormat = ExportFormat.Json,
|
|
|
|
IsBotToken = Secrets.IsDiscordTokenBot,
|
|
|
|
OutputPath = outputFilePath
|
|
|
|
ChannelIds = new[] {Snowflake.Parse(ChannelIds.MentionTestCases)},
|
|
|
|
}.ExecuteAsync(new FakeConsole());
|
|
|
|
ExportFormat = ExportFormat.Json,
|
|
|
|
|
|
|
|
OutputPath = outputFilePath
|
|
|
|
var jsonData = await File.ReadAllTextAsync(outputFilePath);
|
|
|
|
}.ExecuteAsync(new FakeConsole());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return await File.ReadAllTextAsync(outputFilePath);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
_testOutput.WriteLine(jsonData);
|
|
|
|
_testOutput.WriteLine(jsonData);
|
|
|
|
|
|
|
|
|
|
|
|
var json = Json.Parse(jsonData);
|
|
|
|
var json = Json.Parse(jsonData);
|
|
|
@ -280,16 +308,20 @@ namespace DiscordChatExporter.Cli.Tests
|
|
|
|
var outputFilePath = Path.ChangeExtension(_tempOutput.GetTempFilePath(), "html");
|
|
|
|
var outputFilePath = Path.ChangeExtension(_tempOutput.GetTempFilePath(), "html");
|
|
|
|
|
|
|
|
|
|
|
|
// Act
|
|
|
|
// Act
|
|
|
|
await new ExportChannelsCommand
|
|
|
|
var htmlData = await GlobalCache.WrapAsync("mention-specs-output-html", async () =>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TokenValue = Secrets.DiscordToken,
|
|
|
|
await new ExportChannelsCommand
|
|
|
|
IsBotToken = Secrets.IsDiscordTokenBot,
|
|
|
|
{
|
|
|
|
ChannelIds = new[] {Snowflake.Parse(ChannelIds.MentionTestCases)},
|
|
|
|
TokenValue = Secrets.DiscordToken,
|
|
|
|
ExportFormat = ExportFormat.HtmlDark,
|
|
|
|
IsBotToken = Secrets.IsDiscordTokenBot,
|
|
|
|
OutputPath = outputFilePath
|
|
|
|
ChannelIds = new[] {Snowflake.Parse(ChannelIds.MentionTestCases)},
|
|
|
|
}.ExecuteAsync(new FakeConsole());
|
|
|
|
ExportFormat = ExportFormat.HtmlDark,
|
|
|
|
|
|
|
|
OutputPath = outputFilePath
|
|
|
|
var htmlData = await File.ReadAllTextAsync(outputFilePath);
|
|
|
|
}.ExecuteAsync(new FakeConsole());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return await File.ReadAllTextAsync(outputFilePath);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
_testOutput.WriteLine(htmlData);
|
|
|
|
_testOutput.WriteLine(htmlData);
|
|
|
|
|
|
|
|
|
|
|
|
var html = Html.Parse(htmlData);
|
|
|
|
var html = Html.Parse(htmlData);
|
|
|
|