public void SpecialChar_Test() { WordParser.SentenceParser sentenceParser = new WordParser.SentenceParser("Smooth {code}... is, good (code)!"); StringBuilder stringBuilder = new StringBuilder(); string currentWord = sentenceParser.GetNextWord(); while (!string.IsNullOrEmpty(currentWord)) { stringBuilder.Append(currentWord); currentWord = sentenceParser.GetNextWord(); } Assert.AreEqual("Smooth {code}... is, good (code)!", stringBuilder.ToString()); }
public void Apostrophe_Test() { WordParser.SentenceParser sentenceParser = new WordParser.SentenceParser("'This' ol' '01 thing isn't mine."); StringBuilder stringBuilder = new StringBuilder(); string currentWord = sentenceParser.GetNextWord(); while (!string.IsNullOrEmpty(currentWord)) { stringBuilder.Append(currentWord); currentWord = sentenceParser.GetNextWord(); } Assert.AreEqual("'This' ol' '01 thing isnt mine.", stringBuilder.ToString()); }
public void Sentence_Test() { WordParser.SentenceParser sentenceParser = new WordParser.SentenceParser("Smooth code is good code"); StringBuilder stringBuilder = new StringBuilder(); string currentWord = sentenceParser.GetNextWord(); while (!string.IsNullOrEmpty(currentWord)) { stringBuilder.Append(currentWord); currentWord = sentenceParser.GetNextWord(); } Assert.AreEqual("Smooth code is good code", stringBuilder.ToString()); }
public void Empty_Test() { WordParser.SentenceParser sentenceParser = new WordParser.SentenceParser(string.Empty); Assert.AreEqual(string.Empty, sentenceParser.GetNextWord()); }