Exemple #1
0
 public void TestRendererWithFormatAndSeparatorAndNull()
 {
     string template =
             "The names: <names; separator=\" and \", null=\"n/a\", format=\"upper\">";
     TemplateGroup group = new TemplateGroup();
     group.RegisterRenderer(typeof(string), new StringRenderer());
     Template st = new Template(template);
     st.groupThatCreatedThisInstance = group;
     IList names = new ArrayList();
     names.Add("ter");
     names.Add(null);
     names.Add("sriram");
     st.Add("names", names);
     string expecting = "The names: TER and N/A and SRIRAM";
     string result = st.Render();
     Assert.AreEqual(expecting, result);
 }
Exemple #2
0
 public void TestRendererWithFormatAndList()
 {
     string template =
             "The names: <names; format=\"upper\">";
     TemplateGroup group = new TemplateGroup();
     group.RegisterRenderer(typeof(string), new StringRenderer());
     Template st = new Template(template);
     st.groupThatCreatedThisInstance = group;
     st.Add("names", "ter");
     st.Add("names", "tom");
     st.Add("names", "sriram");
     string expecting = "The names: TERTOMSRIRAM";
     string result = st.Render();
     Assert.AreEqual(expecting, result);
 }