mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-02-14 07:43:31 -07:00
Add test for last change
This commit is contained in:
parent
20eeaa58e9
commit
17b548d679
|
|
@ -100,6 +100,34 @@ public record FilterSpecs(TempOutputFixture TempOutput) : IClassFixture<TempOutp
|
||||||
.ContainSingle("This has image");
|
.ContainSingle("This has image");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public async Task Messages_filtered_by_pin_only_include_messages_that_have_been_pinned()
|
||||||
|
{
|
||||||
|
// Arrange
|
||||||
|
var filePath = TempOutput.GetTempFilePath();
|
||||||
|
|
||||||
|
// Act
|
||||||
|
await new ExportChannelsCommand
|
||||||
|
{
|
||||||
|
Token = Secrets.DiscordToken,
|
||||||
|
ChannelIds = new[] { ChannelIds.FilterTestCases },
|
||||||
|
ExportFormat = ExportFormat.Json,
|
||||||
|
OutputPath = filePath,
|
||||||
|
MessageFilter = MessageFilter.Parse("has:pin")
|
||||||
|
}.ExecuteAsync(new FakeConsole());
|
||||||
|
|
||||||
|
var data = await File.ReadAllTextAsync(filePath);
|
||||||
|
var document = Json.Parse(data);
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
document
|
||||||
|
.GetProperty("messages")
|
||||||
|
.EnumerateArray()
|
||||||
|
.Select(j => j.GetProperty("content").GetString())
|
||||||
|
.Should()
|
||||||
|
.ContainSingle("This is pinned");
|
||||||
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public async Task Messages_filtered_by_mention_only_include_messages_that_have_that_mention()
|
public async Task Messages_filtered_by_mention_only_include_messages_that_have_that_mention()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue