public void NameResetBuild() { StringTemplate st = "Let name = #{name};"; st.Assign("name", "R"); string result1 = st.Render(); Assert.AreEqual("Let name = R;", result1); st.Assign("name", "X"); string result2 = st.Render(); Assert.AreEqual("Let name = X;", result2); }
public void TestEscape() { StringTemplate st = "##{test}#{case}"; st.Assign("case", "1"); Assert.AreEqual("#{test}1", st.Render()); }
public void TestMissingNotAllow() { StringTemplate st = "[#{item1},#{item2}]"; st.Assign("item1", "v1"); string r = st.Render(); }
public void TestMissingAllow() { StringTemplate st = "[#{item1},#{item2}]"; st.Assign("item1", "v1"); string r = st.Render(true); Assert.AreEqual("[v1,#{item2}]", r); }
public void NormalBuild() { StringTemplate st = "Let name = #{name};"; st.Assign("name", "R"); string result = st.Render(); Assert.AreEqual("Let name = R;", result); }
public void TestClear() { StringTemplate st = "[#{item}]"; st.Assign("item", "v"); Assert.AreEqual("[v]", st.Render()); st.Clear(); Assert.AreEqual("[#{item}]", st.Render(true)); }
public void TestAssignError() { StringTemplate st = "#{item}"; st.Assign("v", "string"); }