1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 11:37:28 +08:00

add unit test

This commit is contained in:
Lukynka CZE 2023-09-14 17:46:42 +02:00
parent 66751ef5bb
commit 25926af782

View File

@ -32,8 +32,17 @@ namespace osu.Game.Tests.Chat
Message result = MessageFormatter.FormatMessage(new Message { Content = "This is a gopher://really-old-protocol we don't support." }); Message result = MessageFormatter.FormatMessage(new Message { Content = "This is a gopher://really-old-protocol we don't support." });
Assert.AreEqual(result.Content, result.DisplayContent); Assert.AreEqual(result.Content, result.DisplayContent);
Assert.AreEqual(1, result.Links.Count); Assert.AreEqual(0, result.Links.Count);
Assert.AreEqual("gopher://really-old-protocol", result.Links[0].Url); }
[Test]
public void TestSupportedProtocolLinkParsing()
{
Message result = MessageFormatter.FormatMessage(new Message { Content = "forgotspacehttps://dev.ppy.sh joinmyosump://12345 jointheosu://chan/#english" });
Assert.AreEqual("https://dev.ppy.sh", result.Links[0].Url);
Assert.AreEqual("osump://12345", result.Links[1].Url);
Assert.AreEqual("osu://chan/#english", result.Links[2].Url);
} }
[Test] [Test]