示例#1
0
        public void EmptyOrNullShouldReturn0()
        {
            var lw = new LastWord();

            Assert.Equal(0, lw.LengthOfLastWord(""));
            Assert.Equal(0, lw.LengthOfLastWord(null));
        }
示例#2
0
        private int FilterIntellisenseWithCount()
        {
            IEnumerable <string> filtered = ContentAssistSource.Where(s => s.ToUpper().StartsWith(LastWord.ToString().ToUpper()));

            IntellisenseList.ItemsSource   = filtered;
            IntellisenseList.SelectedIndex = 0;
            if (filtered.Count() == 0)
            {
                IntellisenseList.Visibility = System.Windows.Visibility.Collapsed;
            }
            return(filtered.Count());
        }
示例#3
0
        public void NoWordAfterLastSpaceShouldReturnNextToLastWord()
        {
            var lw = new LastWord();

            Assert.Equal(1, lw.LengthOfLastWord("a "));
        }
示例#4
0
        public void HelloWorldShouldReturn5()
        {
            var lw = new LastWord();

            Assert.Equal(5, lw.LengthOfLastWord("Hello World"));
        }