Fixes not matching coding style

This commit is contained in:
tbrose 2021-12-07 01:38:37 +01:00
parent 39594b7362
commit f02e44d552
2 changed files with 3 additions and 2 deletions

View File

@ -7,7 +7,7 @@
namespace osu.Game.Tests.Online.Chat
{
[TestFixture]
public class TestCheckUsername
public class MessageNotifierTest
{
[Test]
public void TestContainsUsernameMidlinePositive()

View File

@ -130,7 +130,8 @@ private void checkForMentions(Channel channel, Message message)
/// Checks if <paramref name="message"/> mentions <paramref name="username"/>.
/// This will match against the case where underscores are used instead of spaces (which is how osu-stable handles usernames with spaces).
/// </summary>
public static bool checkContainsUsername(string message, string username) {
public static bool checkContainsUsername(string message, string username)
{
string fullName = Regex.Escape(username);
string underscoreName = Regex.Escape(username.Replace(' ', '_'));
return new Regex($"\\b({fullName}|{underscoreName})\\b", RegexOptions.IgnoreCase).Matches(message).Count > 0;