public void ParseRole_Pass(string role, ulong id)
        {
            var parsed = MentionUtils.ParseRole(role);

            Assert.Equal(id, parsed);

            Assert.True(MentionUtils.TryParseRole(role, out ulong result));
            Assert.Equal(id, result);
        }
Example #2
0
 public void ParseRole_Null()
 {
     Assert.Throws <NullReferenceException>(() => MentionUtils.ParseRole(null));
     Assert.Throws <NullReferenceException>(() => MentionUtils.TryParseRole(null, out _));
 }
Example #3
0
 public void ParseRole_Fail(string role)
 {
     Assert.Throws <ArgumentException>(() => MentionUtils.ParseRole(role));
     Assert.False(MentionUtils.TryParseRole(role, out _));
 }