public void GetAntExpressionsWithAStringThatDoesntHaveAnyExpressions()
        {
            IList 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, (string[])ArrayList.Adapter(actual).ToArray(typeof(string))));
        }
        public void GetAntExpressionsWithEmptyString()
        {
            IList actual = StringUtils.GetAntExpressions(String.Empty);

            Assert.IsNotNull(actual);
            string[] expected = new string[] {};
            Assert.IsTrue(ArrayUtils.AreEqual(expected, (string[])ArrayList.Adapter(actual).ToArray(typeof(string))));
        }
Esempio n. 3
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()));
        }
 public void GetAntExpressionsIgnoresEmptyExpression()
 {
     StringUtils.GetAntExpressions("This is an empty expression ${}...");
 }
        public void GetAntExpressionsWithMalformedExpression()
        {
            IList actual = StringUtils.GetAntExpressions("Mmm... just what counts as ${a malformed{ expression?");

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

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

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

            CheckGetAntExpressions(actual, "blechh${shudder");
        }
        public void GetAntExpressionsWithAValidExpression()
        {
            IList 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");
        }
 public void GetAntExpressionsIgnoresEmptyExpression()
 {
     Assert.Throws <FormatException>(() => StringUtils.GetAntExpressions("This is an empty expression ${}..."));
 }