public void EmptyOrNullShouldReturn0() { var lw = new LastWord(); Assert.Equal(0, lw.LengthOfLastWord("")); Assert.Equal(0, lw.LengthOfLastWord(null)); }
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()); }
public void NoWordAfterLastSpaceShouldReturnNextToLastWord() { var lw = new LastWord(); Assert.Equal(1, lw.LengthOfLastWord("a ")); }
public void HelloWorldShouldReturn5() { var lw = new LastWord(); Assert.Equal(5, lw.LengthOfLastWord("Hello World")); }