示例#1
0
        public void ParseWordsFromText_Null()
        {
            var result = WordUtitlity.ParseWordsFromText(null);

            Assert.IsNotNull(result);
            Assert.AreEqual(result.Count(), 0);
        }
示例#2
0
        public void ParseWordsFromText_Empty()
        {
            var result = WordUtitlity.ParseWordsFromText(string.Empty);

            Assert.IsNotNull(result);
            Assert.AreEqual(result.Count(), 0);
        }
示例#3
0
        public void ParseWordsFromText_OneWord()
        {
            var result = WordUtitlity.ParseWordsFromText("Test.");

            Assert.IsNotNull(result);
            Assert.AreEqual(result.Count(), 1);
            Assert.AreEqual(result.ElementAtOrDefault(0)?.ToString(), "test");
        }
示例#4
0
        public void ParseWordsFromText_TwoWords_SplittedByComma()
        {
            var result = WordUtitlity.ParseWordsFromText("Test, data.");

            Assert.IsNotNull(result);
            Assert.AreEqual(result.Count(), 2);
            Assert.AreEqual(result.ElementAtOrDefault(0)?.ToString(), "test");
            Assert.AreEqual(result.ElementAtOrDefault(1)?.ToString(), "data");
        }