Add unit test project and some early tests

This commit is contained in:
Ske
2020-06-14 18:56:53 +02:00
parent 2d43c17f9e
commit 0f041c2e3c
6 changed files with 119 additions and 3 deletions

View File

@@ -8,10 +8,13 @@ namespace PluralKit.Bot
{
public class ProxyTagParser
{
public bool TryMatch(IEnumerable<ProxyMember> members, string input, out ProxyMatch result)
public bool TryMatch(IEnumerable<ProxyMember> members, string? input, out ProxyMatch result)
{
result = default;
// Null input is valid and is equivalent to empty string
if (input == null) return false;
// If the message starts with a @mention, and then proceeds to have proxy tags,
// extract the mention and place it inside the inner message
// eg. @Ske [text] => [@Ske text]