Esempio n. 1
0
        public void GetAntExpressionsWithAStringThatDoesntHaveAnyExpressions()
        {
            IList <string> actual = StringUtils.GetAntExpressions("I could really go a cup of tea right now... in fact I think I'll go get one.");

            Assert.IsNotNull(actual);
            string[] expected = new string[] {};
            Assert.IsTrue(ArrayUtils.AreEqual(expected, new List <string>(actual).ToArray()));
        }
Esempio n. 2
0
        public void GetAntExpressionsWithEmptyString()
        {
            IList <string> actual = StringUtils.GetAntExpressions(String.Empty);

            Assert.IsNotNull(actual);
            string[] expected = new string[] {};
            Assert.IsTrue(ArrayUtils.AreEqual(expected, new List <string>(actual).ToArray()));
        }
Esempio n. 3
0
 public void GetAntExpressionsIgnoresEmptyExpression()
 {
     Assert.Throws <FormatException>(() => StringUtils.GetAntExpressions("This is an empty expression ${}..."));
 }
Esempio n. 4
0
        public void GetAntExpressionsWithMalformedExpression()
        {
            IList <string> actual = StringUtils.GetAntExpressions("Mmm... just what counts as ${a malformed{ expression?");

            CheckGetAntExpressions(actual, new string[] {});
        }
Esempio n. 5
0
        public void GetAntExpressionsWithACoupleOfUniqueValidExpressions()
        {
            IList <string> actual = StringUtils.GetAntExpressions("${Mmm}. Has there been any good telly since then... ${thinks}");

            CheckGetAntExpressions(actual, "Mmm", "thinks");
        }
Esempio n. 6
0
        public void GetAntExpressionsWithACoupleOfDuplicatedValidExpressions()
        {
            IList <string> actual = StringUtils.GetAntExpressions("${sigh}. Laura Palmer though... man, that sure was a tragedy. ${sigh}");

            CheckGetAntExpressions(actual, "sigh");
        }
Esempio n. 7
0
        public void GetAntExpressionsWithANestedExpression()
        {
            IList <string> actual = StringUtils.GetAntExpressions("And yeah, I've never been a fan of the doughnut... ${blechh${shudder}}");

            CheckGetAntExpressions(actual, "blechh${shudder");
        }
Esempio n. 8
0
        public void GetAntExpressionsWithAValidExpression()
        {
            IList <string> actual = StringUtils.GetAntExpressions("${slurp}. Ah! That is one good cup of tea. That agent Cooper and his coffee... he sure was missing out on a good thing.");

            CheckGetAntExpressions(actual, "slurp");
        }