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