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())); }
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() { Assert.Throws <FormatException>(() => StringUtils.GetAntExpressions("This is an empty expression ${}...")); }
public void GetAntExpressionsWithMalformedExpression() { IList <string> actual = StringUtils.GetAntExpressions("Mmm... just what counts as ${a malformed{ expression?"); CheckGetAntExpressions(actual, new string[] {}); }
public void GetAntExpressionsWithACoupleOfUniqueValidExpressions() { IList <string> actual = StringUtils.GetAntExpressions("${Mmm}. Has there been any good telly since then... ${thinks}"); CheckGetAntExpressions(actual, "Mmm", "thinks"); }
public void GetAntExpressionsWithACoupleOfDuplicatedValidExpressions() { IList <string> actual = StringUtils.GetAntExpressions("${sigh}. Laura Palmer though... man, that sure was a tragedy. ${sigh}"); CheckGetAntExpressions(actual, "sigh"); }
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"); }
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"); }