public void MatchAString() { Terminal t = new Terminal("AAA", "AAA"); const string aString = "AAABBB"; string match; Assert.IsTrue(t.Match(aString, 0, out match)); Assert.AreEqual("AAA", match); }
public void MatchAStringNotAtIndexZeroButWithOffset() { Terminal t = new Terminal("AAA", "AAA"); string aString = "BBBAAA"; string match; Assert.IsTrue(t.Match(aString, 3, out match)); Assert.AreEqual("AAA", match); }
public void DoNotMatchAStringNotAtIndexZero() { Terminal t = new Terminal("AAA", "AAA"); string aString = "BBBAAA"; string match; Assert.IsFalse(t.Match(aString, 0, out match)); Assert.IsNull(match); }