Esempio n. 1
0
 public void TestRendererForGroup()
 {
     string templates =
             "group test;" + newline +
             "dateThing(created) ::= \"date: <created>\"" + newline
             ;
     StringTemplateGroup group =
             new StringTemplateGroup( new StringReader( templates ) );
     StringTemplate st = group.GetInstanceOf( "dateThing" );
     st.SetAttribute( "created",
                     new DateTime( 2005, 07, 05 ) );
     group.RegisterRenderer( typeof( DateTime ), new DateRenderer() );
     string expecting = "date: 2005.07.05";
     string result = st.ToString();
     Assert.AreEqual( expecting, result );
 }