예제 #1
0
 public void ParseChannel_Fail(string channel)
 {
     Assert.Throws <ArgumentException>(() => MentionUtils.ParseChannel(channel));
     Assert.False(MentionUtils.TryParseChannel(channel, out _));
 }
예제 #2
0
 public void ParseUser_Null()
 {
     Assert.Throws <NullReferenceException>(() => MentionUtils.ParseUser(null));
     Assert.Throws <NullReferenceException>(() => MentionUtils.TryParseUser(null, out _));
 }
예제 #3
0
 public void ParseUser_Fail(string user)
 {
     Assert.Throws <ArgumentException>(() => MentionUtils.ParseUser(user));
     Assert.False(MentionUtils.TryParseUser(user, out _));
 }
예제 #4
0
 public void MentionRole()
 {
     Assert.Equal("<@&123>", MentionUtils.MentionRole(123u));
     Assert.Equal("<@&123>", MentionUtils.MentionRole("123"));
 }
예제 #5
0
 public void MentionChannel()
 {
     Assert.Equal("<#123>", MentionUtils.MentionChannel(123u));
     Assert.Equal("<#123>", MentionUtils.MentionChannel("123"));
 }
예제 #6
0
 public void ParseRole_Fail(string role)
 {
     Assert.Throws <ArgumentException>(() => MentionUtils.ParseRole(role));
     Assert.False(MentionUtils.TryParseRole(role, out _));
 }