public void ParseUser_Pass(string user, ulong id)
        {
            var parsed = MentionUtils.ParseUser(user);

            Assert.Equal(id, parsed);

            Assert.True(MentionUtils.TryParseUser(user, out ulong result));
            Assert.Equal(id, result);
        }
Example #2
0
 public void ParseUser_Null()
 {
     Assert.Throws <NullReferenceException>(() => MentionUtils.ParseUser(null));
     Assert.Throws <NullReferenceException>(() => MentionUtils.TryParseUser(null, out _));
 }
Example #3
0
 public void ParseUser_Fail(string user)
 {
     Assert.Throws <ArgumentException>(() => MentionUtils.ParseUser(user));
     Assert.False(MentionUtils.TryParseUser(user, out _));
 }