Exemple #1
0
        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);
        }
Exemple #2
0
        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);
        }
Exemple #3
0
        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);
        }