public void MatchSingleInSentence() { var sentence = "This has a pause [pause: 2] right here."; var matches = new PauseTagMatcher().Matches(sentence); Assert.IsTrue(matches.Any(), "No matches found."); Assert.IsTrue(matches.Count == 1, "More than one match."); var match = matches[0]; Assert.IsTrue(match.Start == 17, "Match start was incorrect."); Assert.IsTrue(match.End == 26, "Match end was incorrect."); }
public void MatchMultipleInSentence() { var sentence = "This has [pause: 2] many [pause: 2.4] pauses."; var matches = new PauseTagMatcher().Matches(sentence); Assert.IsTrue(matches.Any(), "No matches found."); Assert.IsTrue(matches.Count == 2, "Didn't match all."); }