コード例 #1
0
        /// <summary>
        /// Adds the tokens.
        /// </summary>
        /// <param name="tokens">The tokens.</param>
        /// <param name="tokenkind">The token kind.</param>
        private void AddTokens(string tokens, TraceUtilities.TokenKind tokenkind)
        {
            StringBuilder curtoken = new StringBuilder();

            for (int i = 0; i < tokens.Length; i++)
            {
                if (tokens[i] == ',')
                {
                    string s = curtoken.ToString().ToLower();
                    if (!this.words.ContainsKey(s))
                    {
                        this.words.Add(s, tokenkind);
                    }

                    curtoken = new StringBuilder();
                }
                else
                {
                    curtoken.Append(tokens[i]);
                }
            }

            if (curtoken.Length != 0)
            {
                this.words.Add(curtoken.ToString(), tokenkind);
            }
        }
コード例 #2
0
 public TraceUtilities.TokenKind ItemGet([PexAssumeUnderTest] Sqltokens target, string token)
 {
     TraceUtilities.TokenKind result = target[token];
     return(result);
     // TODO: add assertions to method SqltokensTest.ItemGet(Sqltokens, String)
 }