public void MatchListMultipleInSentence() { var sentence = "This [voice: male]has multiple[endvoice][voice: female] matches.[endvoice]"; var matches = new EndVoiceTagMatcher().Matches(sentence); Assert.IsTrue(matches.Any(), "No matches found."); Assert.IsTrue(matches.Count == 2, "Didn't match all."); }
public void MatchListSingleInSentence() { var sentence = "This is [voice: female]a test[endvoice]."; var matches = new EndVoiceTagMatcher().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 == 29, "Match start was incorrect."); Assert.IsTrue(match.End == 38, "Match end was incorrect."); }