More namespace refactoring

pull/1001/head
Oleksii Holub 1 year ago
parent 4cb8866429
commit 90c68e3cde

@ -4,13 +4,13 @@ using DiscordChatExporter.Cli.Tests.TestData;
using FluentAssertions; using FluentAssertions;
using Xunit; using Xunit;
namespace DiscordChatExporter.Cli.Tests.Specs.Csv; namespace DiscordChatExporter.Cli.Tests.Specs;
public class ContentSpecs : IClassFixture<ExportWrapperFixture> public class CsvContentSpecs : IClassFixture<ExportWrapperFixture>
{ {
private readonly ExportWrapperFixture _exportWrapper; private readonly ExportWrapperFixture _exportWrapper;
public ContentSpecs(ExportWrapperFixture exportWrapper) public CsvContentSpecs(ExportWrapperFixture exportWrapper)
{ {
_exportWrapper = exportWrapper; _exportWrapper = exportWrapper;
} }

@ -7,13 +7,13 @@ using DiscordChatExporter.Core.Discord;
using FluentAssertions; using FluentAssertions;
using Xunit; using Xunit;
namespace DiscordChatExporter.Cli.Tests.Specs.Html; namespace DiscordChatExporter.Cli.Tests.Specs;
public class AttachmentSpecs : IClassFixture<ExportWrapperFixture> public class HtmlAttachmentSpecs : IClassFixture<ExportWrapperFixture>
{ {
private readonly ExportWrapperFixture _exportWrapper; private readonly ExportWrapperFixture _exportWrapper;
public AttachmentSpecs(ExportWrapperFixture exportWrapper) public HtmlAttachmentSpecs(ExportWrapperFixture exportWrapper)
{ {
_exportWrapper = exportWrapper; _exportWrapper = exportWrapper;
} }

@ -6,13 +6,13 @@ using DiscordChatExporter.Cli.Tests.TestData;
using FluentAssertions; using FluentAssertions;
using Xunit; using Xunit;
namespace DiscordChatExporter.Cli.Tests.Specs.Html; namespace DiscordChatExporter.Cli.Tests.Specs;
public class ContentSpecs : IClassFixture<ExportWrapperFixture> public class HtmlContentSpecs : IClassFixture<ExportWrapperFixture>
{ {
private readonly ExportWrapperFixture _exportWrapper; private readonly ExportWrapperFixture _exportWrapper;
public ContentSpecs(ExportWrapperFixture exportWrapper) public HtmlContentSpecs(ExportWrapperFixture exportWrapper)
{ {
_exportWrapper = exportWrapper; _exportWrapper = exportWrapper;
} }

@ -7,13 +7,13 @@ using DiscordChatExporter.Core.Discord;
using FluentAssertions; using FluentAssertions;
using Xunit; using Xunit;
namespace DiscordChatExporter.Cli.Tests.Specs.Html; namespace DiscordChatExporter.Cli.Tests.Specs;
public class EmbedSpecs : IClassFixture<ExportWrapperFixture> public class HtmlEmbedSpecs : IClassFixture<ExportWrapperFixture>
{ {
private readonly ExportWrapperFixture _exportWrapper; private readonly ExportWrapperFixture _exportWrapper;
public EmbedSpecs(ExportWrapperFixture exportWrapper) public HtmlEmbedSpecs(ExportWrapperFixture exportWrapper)
{ {
_exportWrapper = exportWrapper; _exportWrapper = exportWrapper;
} }

@ -11,13 +11,13 @@ using DiscordChatExporter.Core.Exporting;
using FluentAssertions; using FluentAssertions;
using Xunit; using Xunit;
namespace DiscordChatExporter.Cli.Tests.Specs.Html; namespace DiscordChatExporter.Cli.Tests.Specs;
public class GroupingSpecs : IClassFixture<TempOutputFixture> public class HtmlGroupingSpecs : IClassFixture<TempOutputFixture>
{ {
private readonly TempOutputFixture _tempOutput; private readonly TempOutputFixture _tempOutput;
public GroupingSpecs(TempOutputFixture tempOutput) public HtmlGroupingSpecs(TempOutputFixture tempOutput)
{ {
_tempOutput = tempOutput; _tempOutput = tempOutput;
} }

@ -6,13 +6,13 @@ using DiscordChatExporter.Core.Discord;
using FluentAssertions; using FluentAssertions;
using Xunit; using Xunit;
namespace DiscordChatExporter.Cli.Tests.Specs.Html; namespace DiscordChatExporter.Cli.Tests.Specs;
public class MentionSpecs : IClassFixture<ExportWrapperFixture> public class HtmlMentionSpecs : IClassFixture<ExportWrapperFixture>
{ {
private readonly ExportWrapperFixture _exportWrapper; private readonly ExportWrapperFixture _exportWrapper;
public MentionSpecs(ExportWrapperFixture exportWrapper) public HtmlMentionSpecs(ExportWrapperFixture exportWrapper)
{ {
_exportWrapper = exportWrapper; _exportWrapper = exportWrapper;
} }

@ -6,13 +6,13 @@ using DiscordChatExporter.Core.Discord;
using FluentAssertions; using FluentAssertions;
using Xunit; using Xunit;
namespace DiscordChatExporter.Cli.Tests.Specs.Html; namespace DiscordChatExporter.Cli.Tests.Specs;
public class ReplySpecs : IClassFixture<ExportWrapperFixture> public class HtmlReplySpecs : IClassFixture<ExportWrapperFixture>
{ {
private readonly ExportWrapperFixture _exportWrapper; private readonly ExportWrapperFixture _exportWrapper;
public ReplySpecs(ExportWrapperFixture exportWrapper) public HtmlReplySpecs(ExportWrapperFixture exportWrapper)
{ {
_exportWrapper = exportWrapper; _exportWrapper = exportWrapper;
} }

@ -5,13 +5,13 @@ using DiscordChatExporter.Core.Discord;
using FluentAssertions; using FluentAssertions;
using Xunit; using Xunit;
namespace DiscordChatExporter.Cli.Tests.Specs.Html; namespace DiscordChatExporter.Cli.Tests.Specs;
public class StickerSpecs : IClassFixture<ExportWrapperFixture> public class HtmlStickerSpecs : IClassFixture<ExportWrapperFixture>
{ {
private readonly ExportWrapperFixture _exportWrapper; private readonly ExportWrapperFixture _exportWrapper;
public StickerSpecs(ExportWrapperFixture exportWrapper) public HtmlStickerSpecs(ExportWrapperFixture exportWrapper)
{ {
_exportWrapper = exportWrapper; _exportWrapper = exportWrapper;
} }

@ -6,13 +6,13 @@ using DiscordChatExporter.Core.Discord;
using FluentAssertions; using FluentAssertions;
using Xunit; using Xunit;
namespace DiscordChatExporter.Cli.Tests.Specs.Json; namespace DiscordChatExporter.Cli.Tests.Specs;
public class AttachmentSpecs : IClassFixture<ExportWrapperFixture> public class JsonAttachmentSpecs : IClassFixture<ExportWrapperFixture>
{ {
private readonly ExportWrapperFixture _exportWrapper; private readonly ExportWrapperFixture _exportWrapper;
public AttachmentSpecs(ExportWrapperFixture exportWrapper) public JsonAttachmentSpecs(ExportWrapperFixture exportWrapper)
{ {
_exportWrapper = exportWrapper; _exportWrapper = exportWrapper;
} }

@ -5,13 +5,13 @@ using DiscordChatExporter.Cli.Tests.TestData;
using FluentAssertions; using FluentAssertions;
using Xunit; using Xunit;
namespace DiscordChatExporter.Cli.Tests.Specs.Json; namespace DiscordChatExporter.Cli.Tests.Specs;
public class ContentSpecs : IClassFixture<ExportWrapperFixture> public class JsonContentSpecs : IClassFixture<ExportWrapperFixture>
{ {
private readonly ExportWrapperFixture _exportWrapper; private readonly ExportWrapperFixture _exportWrapper;
public ContentSpecs(ExportWrapperFixture exportWrapper) public JsonContentSpecs(ExportWrapperFixture exportWrapper)
{ {
_exportWrapper = exportWrapper; _exportWrapper = exportWrapper;
} }

@ -6,13 +6,13 @@ using DiscordChatExporter.Core.Discord;
using FluentAssertions; using FluentAssertions;
using Xunit; using Xunit;
namespace DiscordChatExporter.Cli.Tests.Specs.Json; namespace DiscordChatExporter.Cli.Tests.Specs;
public class EmbedSpecs : IClassFixture<ExportWrapperFixture> public class JsonEmbedSpecs : IClassFixture<ExportWrapperFixture>
{ {
private readonly ExportWrapperFixture _exportWrapper; private readonly ExportWrapperFixture _exportWrapper;
public EmbedSpecs(ExportWrapperFixture exportWrapper) public JsonEmbedSpecs(ExportWrapperFixture exportWrapper)
{ {
_exportWrapper = exportWrapper; _exportWrapper = exportWrapper;
} }

@ -6,13 +6,13 @@ using DiscordChatExporter.Core.Discord;
using FluentAssertions; using FluentAssertions;
using Xunit; using Xunit;
namespace DiscordChatExporter.Cli.Tests.Specs.Json; namespace DiscordChatExporter.Cli.Tests.Specs;
public class MentionSpecs : IClassFixture<ExportWrapperFixture> public class JsonMentionSpecs : IClassFixture<ExportWrapperFixture>
{ {
private readonly ExportWrapperFixture _exportWrapper; private readonly ExportWrapperFixture _exportWrapper;
public MentionSpecs(ExportWrapperFixture exportWrapper) public JsonMentionSpecs(ExportWrapperFixture exportWrapper)
{ {
_exportWrapper = exportWrapper; _exportWrapper = exportWrapper;
} }

@ -6,13 +6,13 @@ using DiscordChatExporter.Core.Discord;
using FluentAssertions; using FluentAssertions;
using Xunit; using Xunit;
namespace DiscordChatExporter.Cli.Tests.Specs.Json; namespace DiscordChatExporter.Cli.Tests.Specs;
public class StickerSpecs : IClassFixture<ExportWrapperFixture> public class JsonStickerSpecs : IClassFixture<ExportWrapperFixture>
{ {
private readonly ExportWrapperFixture _exportWrapper; private readonly ExportWrapperFixture _exportWrapper;
public StickerSpecs(ExportWrapperFixture exportWrapper) public JsonStickerSpecs(ExportWrapperFixture exportWrapper)
{ {
_exportWrapper = exportWrapper; _exportWrapper = exportWrapper;
} }

@ -4,13 +4,13 @@ using DiscordChatExporter.Cli.Tests.TestData;
using FluentAssertions; using FluentAssertions;
using Xunit; using Xunit;
namespace DiscordChatExporter.Cli.Tests.Specs.PlainText; namespace DiscordChatExporter.Cli.Tests.Specs;
public class ContentSpecs : IClassFixture<ExportWrapperFixture> public class PlainTextContentSpecs : IClassFixture<ExportWrapperFixture>
{ {
private readonly ExportWrapperFixture _exportWrapper; private readonly ExportWrapperFixture _exportWrapper;
public ContentSpecs(ExportWrapperFixture exportWrapper) public PlainTextContentSpecs(ExportWrapperFixture exportWrapper)
{ {
_exportWrapper = exportWrapper; _exportWrapper = exportWrapper;
} }

@ -32,7 +32,7 @@ public record Message(
if (embeds.Count <= 1) if (embeds.Count <= 1)
return embeds; return embeds;
// Discord API doesn't support embeds with multiple images, even though the Discord client does. // Discord API doesn't support embeds with multiple images, even though Discord client does.
// To work around this, it seems that the API returns multiple consecutive embeds with different images, // To work around this, it seems that the API returns multiple consecutive embeds with different images,
// which are then merged together on the client. We need to replicate the same behavior ourselves. // which are then merged together on the client. We need to replicate the same behavior ourselves.
// Currently, only known case where this workaround is required is Twitter embeds. // Currently, only known case where this workaround is required is Twitter embeds.

@ -14,7 +14,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<RazorBlade Include="Exporting\Html\*.cshtml" /> <RazorBlade Include="**\*.cshtml" />
</ItemGroup> </ItemGroup>
</Project> </Project>

@ -4,10 +4,9 @@ using System.Text;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using DiscordChatExporter.Core.Discord.Data; using DiscordChatExporter.Core.Discord.Data;
using DiscordChatExporter.Core.Exporting.PlainText;
using DiscordChatExporter.Core.Utils.Extensions; using DiscordChatExporter.Core.Utils.Extensions;
namespace DiscordChatExporter.Core.Exporting.Csv; namespace DiscordChatExporter.Core.Exporting;
internal partial class CsvMessageWriter : MessageWriter internal partial class CsvMessageWriter : MessageWriter
{ {

@ -10,7 +10,7 @@ using DiscordChatExporter.Core.Markdown;
using DiscordChatExporter.Core.Markdown.Parsing; using DiscordChatExporter.Core.Markdown.Parsing;
using DiscordChatExporter.Core.Utils.Extensions; using DiscordChatExporter.Core.Utils.Extensions;
namespace DiscordChatExporter.Core.Exporting.Html; namespace DiscordChatExporter.Core.Exporting;
internal partial class HtmlMarkdownVisitor : MarkdownVisitor internal partial class HtmlMarkdownVisitor : MarkdownVisitor
{ {

@ -2,9 +2,9 @@ using System;
using DiscordChatExporter.Core.Discord.Data; using DiscordChatExporter.Core.Discord.Data;
using DiscordChatExporter.Core.Discord.Data.Embeds; using DiscordChatExporter.Core.Discord.Data.Embeds;
namespace DiscordChatExporter.Core.Exporting.Html; namespace DiscordChatExporter.Core.Exporting;
internal static class MessageExtensions internal static class HtmlMessageExtensions
{ {
// Message content is hidden if it's a link to an embedded media // Message content is hidden if it's a link to an embedded media
// https://github.com/Tyrrrz/DiscordChatExporter/issues/682 // https://github.com/Tyrrrz/DiscordChatExporter/issues/682

@ -7,7 +7,7 @@ using System.Threading.Tasks;
using DiscordChatExporter.Core.Discord.Data; using DiscordChatExporter.Core.Discord.Data;
using WebMarkupMin.Core; using WebMarkupMin.Core;
namespace DiscordChatExporter.Core.Exporting.Html; namespace DiscordChatExporter.Core.Exporting;
internal class HtmlMessageWriter : MessageWriter internal class HtmlMessageWriter : MessageWriter
{ {

@ -5,11 +5,10 @@ using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using DiscordChatExporter.Core.Discord.Data; using DiscordChatExporter.Core.Discord.Data;
using DiscordChatExporter.Core.Discord.Data.Embeds; using DiscordChatExporter.Core.Discord.Data.Embeds;
using DiscordChatExporter.Core.Exporting.PlainText;
using DiscordChatExporter.Core.Utils.Extensions; using DiscordChatExporter.Core.Utils.Extensions;
using JsonExtensions.Writing; using JsonExtensions.Writing;
namespace DiscordChatExporter.Core.Exporting.Json; namespace DiscordChatExporter.Core.Exporting;
internal class JsonMessageWriter : MessageWriter internal class JsonMessageWriter : MessageWriter
{ {

@ -3,10 +3,6 @@ using System.IO;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using DiscordChatExporter.Core.Discord.Data; using DiscordChatExporter.Core.Discord.Data;
using DiscordChatExporter.Core.Exporting.Csv;
using DiscordChatExporter.Core.Exporting.Html;
using DiscordChatExporter.Core.Exporting.Json;
using DiscordChatExporter.Core.Exporting.PlainText;
namespace DiscordChatExporter.Core.Exporting; namespace DiscordChatExporter.Core.Exporting;

@ -5,7 +5,7 @@ using DiscordChatExporter.Core.Markdown;
using DiscordChatExporter.Core.Markdown.Parsing; using DiscordChatExporter.Core.Markdown.Parsing;
using DiscordChatExporter.Core.Utils.Extensions; using DiscordChatExporter.Core.Utils.Extensions;
namespace DiscordChatExporter.Core.Exporting.PlainText; namespace DiscordChatExporter.Core.Exporting;
internal partial class PlainTextMarkdownVisitor : MarkdownVisitor internal partial class PlainTextMarkdownVisitor : MarkdownVisitor
{ {

@ -6,7 +6,7 @@ using System.Threading.Tasks;
using DiscordChatExporter.Core.Discord.Data; using DiscordChatExporter.Core.Discord.Data;
using DiscordChatExporter.Core.Discord.Data.Embeds; using DiscordChatExporter.Core.Discord.Data.Embeds;
namespace DiscordChatExporter.Core.Exporting.PlainText; namespace DiscordChatExporter.Core.Exporting;
internal class PlainTextMessageWriter : MessageWriter internal class PlainTextMessageWriter : MessageWriter
{ {
Loading…
Cancel
Save