public void CanFindSingleEnvironmentParameter() { var sut = new ParameterParser(); string data = "This is a Test ${ENV:testvalue} this is a test"; var result = sut.FindEnvironmentParameters(data); Assert.AreEqual(1, result.Count); Assert.AreEqual("testvalue", result[0]); }
public void HandlesDuplicates() { var sut = new ParameterParser(); string data = "This is a Test ${env:testvalue} this is a test${ENV:testvalue2} and again ${env:testvalue} ..."; var result = sut.FindEnvironmentParameters(data); Assert.AreEqual(2, result.Count); Assert.AreEqual("testvalue", result[0]); Assert.AreEqual("testvalue2", result[1]); }
public void IsCaseInsensitive() { var sut = new ParameterParser(); string data = "This is a Test ${env:testvalue} this is a test${EnV:testvalue2}..."; var result = sut.FindEnvironmentParameters(data); Assert.AreEqual(2, result.Count); Assert.AreEqual("testvalue", result[0]); Assert.AreEqual("testvalue2", result[1]); }
public void IgnoresEnvironmentParameters() { var sut = new ParameterParser(); string data = "This is a Test ${ENV:testvalue} this ${MACHINE:ignoreMe} is a test${ENV:testvalue2}..."; var result = sut.FindEnvironmentParameters(data); Assert.AreEqual(2, result.Count); Assert.AreEqual("testvalue", result[0]); Assert.AreEqual("testvalue2", result[1]); }