示例#1
0
        public void CountWordsTestWhitespaceResult()
        {
            string       s           = "        ";
            int          rightResult = 0;
            SimpleParser parser      = new SimpleParser();
            var          result      = parser.CountWords(s);

            Assert.AreEqual(rightResult, result.Count);
        }
示例#2
0
        public void CountWordsTestRightResult()
        {
            string s           = "אכ�פא אכ�פא מלודא בנאגמ";
            var    rightResult = new Dictionary <string, int>
            {
                { "אכ�פא", 2 },
                { "מלודא", 1 },
                { "בנאגמ", 1 }
            };
            SimpleParser parser = new SimpleParser();
            var          result = parser.CountWords(s);

            CollectionAssert.AreEquivalent(rightResult.ToList(), result.ToList());
        }