Esempio n. 1
0
 public void TestMethod1()
 {
     Assert.AreEqual(4, CharCounts.CharacterCount("Mississippi", 's'));
     Assert.AreEqual(1, CharCounts.CharacterCount("dog", 'o'));
     Assert.AreEqual(1, Program.NumOccurences("904tu whwrb w495y8um49u bw509yu .", '.'));
     Assert.AreEqual(7, Program.NumOccurences("Awadda oo mao mao, baba o mao mamao", 'o'));
 }
Esempio n. 2
0
            public void Insert(char c)
            {
                var pos = CharPos[c];

                if (pos == NoWhere)
                {
                    pos        = CharCounts.Count;
                    CharPos[c] = pos;
                    CharCounts.Add(Record.Create(c));
                }
                else
                {
                    CharCounts[pos].Add();
                }

                if (CurChar == NoResult || CurChar == c)
                {
                    UpdateCurChar();
                }
            }