mirror of
https://github.com/ppy/osu.git
synced 2024-12-16 02:22:59 +08:00
Add mention tests
This commit is contained in:
parent
00da45ead4
commit
16c500d0b0
27
osu.Game.Tests/Chat/MessageNotifierTests.cs
Normal file
27
osu.Game.Tests/Chat/MessageNotifierTests.cs
Normal file
@ -0,0 +1,27 @@
|
||||
using NUnit.Framework;
|
||||
using osu.Game.Online.Chat;
|
||||
|
||||
namespace osu.Game.Tests.Chat
|
||||
{
|
||||
[TestFixture]
|
||||
public class MessageNotifierTests
|
||||
{
|
||||
private readonly MessageNotifier messageNotifier = new MessageNotifier();
|
||||
|
||||
[Test]
|
||||
public void TestMentions()
|
||||
{
|
||||
// Message (with mention, different casing)
|
||||
Assert.IsTrue(messageNotifier.IsMentioning("Hey, Somebody Playing OSU!", "Somebody playing osu!"));
|
||||
|
||||
// Message (with mention, underscores)
|
||||
Assert.IsTrue(messageNotifier.IsMentioning("Hey, Somebody_playing_osu!", "Somebody playing osu!"));
|
||||
|
||||
// Message (with mention, different casing, underscores)
|
||||
Assert.IsTrue(messageNotifier.IsMentioning("Hey, Somebody_Playing_OSU!", "Somebody playing osu!"));
|
||||
|
||||
// Message (without mention)
|
||||
Assert.IsTrue(!messageNotifier.IsMentioning("peppy, can you please fix this?", "Cookiezi"));
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user