mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2025-05-20 09:55:08 -04:00
Make test assertions more relaxed in terms of user-made content URLs
This commit is contained in:
parent
5f343a46d1
commit
062427d143
2 changed files with 9 additions and 19 deletions
|
@ -27,13 +27,7 @@ public class HtmlAttachmentSpecs
|
||||||
.QuerySelectorAll("a")
|
.QuerySelectorAll("a")
|
||||||
.Select(e => e.GetAttribute("href"))
|
.Select(e => e.GetAttribute("href"))
|
||||||
.Should()
|
.Should()
|
||||||
.Contain(
|
.Contain(u => u.Contains("Test.txt", StringComparison.Ordinal));
|
||||||
u =>
|
|
||||||
u.StartsWith(
|
|
||||||
"https://cdn.discordapp.com/attachments/885587741654536192/885587844964417596/Test.txt",
|
|
||||||
StringComparison.Ordinal
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
|
@ -52,13 +46,7 @@ public class HtmlAttachmentSpecs
|
||||||
.QuerySelectorAll("img")
|
.QuerySelectorAll("img")
|
||||||
.Select(e => e.GetAttribute("src"))
|
.Select(e => e.GetAttribute("src"))
|
||||||
.Should()
|
.Should()
|
||||||
.Contain(
|
.Contain(u => u.Contains("bird-thumbnail.png", StringComparison.Ordinal));
|
||||||
u =>
|
|
||||||
u.StartsWith(
|
|
||||||
"https://cdn.discordapp.com/attachments/885587741654536192/885654862430359613/bird-thumbnail.png",
|
|
||||||
StringComparison.Ordinal
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
using System.Linq;
|
using System;
|
||||||
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using AngleSharp.Dom;
|
using AngleSharp.Dom;
|
||||||
using DiscordChatExporter.Cli.Tests.Infra;
|
using DiscordChatExporter.Cli.Tests.Infra;
|
||||||
|
@ -54,7 +55,7 @@ public class HtmlEmbedSpecs
|
||||||
.QuerySelectorAll("img")
|
.QuerySelectorAll("img")
|
||||||
.Select(e => e.GetAttribute("src"))
|
.Select(e => e.GetAttribute("src"))
|
||||||
.WhereNotNull()
|
.WhereNotNull()
|
||||||
.Where(s => s.EndsWith("f8w05ja8s4e61.png"))
|
.Where(s => s.Contains("f8w05ja8s4e61.png", StringComparison.Ordinal))
|
||||||
.Should()
|
.Should()
|
||||||
.ContainSingle();
|
.ContainSingle();
|
||||||
}
|
}
|
||||||
|
@ -91,8 +92,9 @@ public class HtmlEmbedSpecs
|
||||||
.WhereNotNull()
|
.WhereNotNull()
|
||||||
.Where(
|
.Where(
|
||||||
s =>
|
s =>
|
||||||
s.EndsWith(
|
s.Contains(
|
||||||
"i_am_currently_feeling_slight_displeasure_of_what_you_have_just_sent_lqrem.mp4"
|
"i_am_currently_feeling_slight_displeasure_of_what_you_have_just_sent_lqrem.mp4",
|
||||||
|
StringComparison.Ordinal
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
.Should()
|
.Should()
|
||||||
|
@ -113,7 +115,7 @@ public class HtmlEmbedSpecs
|
||||||
.QuerySelectorAll("source")
|
.QuerySelectorAll("source")
|
||||||
.Select(e => e.GetAttribute("src"))
|
.Select(e => e.GetAttribute("src"))
|
||||||
.WhereNotNull()
|
.WhereNotNull()
|
||||||
.Where(s => s.EndsWith("tooncasm-test-copy.mp4"))
|
.Where(s => s.Contains("tooncasm-test-copy.mp4", StringComparison.Ordinal))
|
||||||
.Should()
|
.Should()
|
||||||
.ContainSingle();
|
.ContainSingle();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue