public void Test_Expand() { Props v = new Props(); v.Set("var1", "value1"); v.Set("var2", "value2"); string text = "${var1}-bla-bla-${var2}-tra-la-la-${var1}-ha-${var444}-ha-${var2}"; string subst = v.Expand(text); Assert.AreEqual("value1-bla-bla-value2-tra-la-la-value1-ha-${var444}-ha-value2", subst); text = "${var1}-${0}-${var2}-${1}"; subst = v.Expand(text, "param1", "param2"); Assert.AreEqual("value1-param1-value2-param2", subst); }
public void Test_Expand_Recursive() { Props v = new Props(); v.Set("var1", "111-${var2}-222"); v.Set("var2", "value2"); string text = "ttt-${var1}-TTT"; string subst = v.Expand(text); Assert.AreEqual("ttt-111-value2-222-TTT", subst); }