public void ParseValidAsync( string userData, MentionType expectedType, ulong expectedId, string expectedData) { bool result = Mention.TryParse(userData, out var mention); Assert.True(result); Assert.Equal(expectedType, mention.Type); Assert.Equal(expectedId, mention.Id); Assert.Equal(expectedData, mention.Data); }
public MentionNode(string source, string id, MentionType type) : base(source) { Id = id; Type = type; }
public MentionNode(string id, MentionType type) { Id = id; Type = type; }
public MentionNode(string lexeme, string id, MentionType type) : base(lexeme) { Id = id; Type = type; }
public InvalidMentionTypeException(MentionType expected, MentionType actual) { this.expectedType = expected; this.actualType = actual; }
private static void HandleUser(string text, StringBuilder builder, ref int index, ref MentionType type, char c) { if (c == '!') { index++; ReadDigits(text, builder, ref index); } else if (char.IsDigit(c)) { ReadDigits(text, builder, ref index); } else if (c == '&') { index++; ReadDigits(text, builder, ref index); type = MentionType.Role; } }
public Mention(ulong id, MentionType type, string data = null) { Id = id; Type = type; Data = data; }