예제 #1
0
 public void InsertTemplateWithOneSimpleAttribute()
 {
     var tag = new InsertTemplate()
                   {
                       Template = new MockAttribute(new Constant("insertBMaster.htm"))
                   };
     tag.Factory = _factory;
     var titleAttribute = new PutAttribute()
                              {
                                  Name = new MockAttribute(new Constant("title")),
                                  Value = new MockAttribute(new Constant("Dit is de Test Title"))
                              };
     tag.AddNestedTag(titleAttribute);
     string expected = (new StreamReader("insertBExpected.htm")).ReadToEnd();
     string value = tag.Evaluate(_model);
     Assert.That(value, Is.EqualTo(expected));
 }
예제 #2
0
 public void InsertTemplateWithUrlAttribute()
 {
     var tag = new InsertTemplate()
                   {
                       Template = new MockAttribute(new Constant("insertDMaster.htm"))
                   };
     tag.Factory = _factory;
     var moduleAttribute = new PutAttribute()
                               {
                                   Name = new MockAttribute(new Constant("modules")),
                                   Value = new MockAttribute(new Constant("insertDAdditional.htm"))
                               };
     tag.AddNestedTag(moduleAttribute);
     var bodyAttribute = new PutAttribute()
                             {
                                 Name = new MockAttribute(new Constant("body")),
                                 Value = new MockAttribute(new Constant("Dit is de Test Body"))
                             };
     tag.AddNestedTag(bodyAttribute);
     string expected = (new StreamReader("insertDExpected.htm")).ReadToEnd();
     string value = tag.Evaluate(_model);
     Assert.That(value, Is.EqualTo(expected));
 }
예제 #3
0
 public void InsertTemplateCachesTile()
 {
     var tag = new InsertTemplate()
     {
         Template = new MockAttribute(new Constant("insertEMaster.htm"))
     };
     tag.Factory = _factory;
     var bodyAttribute = new PutAttribute()
     {
         Name = new MockAttribute(new Constant("body")),
         Body = new MockAttribute(new Constant("Dit is de Test Body"))
     };
     tag.AddNestedTag(bodyAttribute);
     tag.Evaluate(_model);
     var tile = tag.Tile;
     tag.Evaluate(_model);
     Assert.That(tag.Tile, Is.SameAs(tile));
 }