Exemplo n.º 1
0
 public void CheckRequired()
 {
     var tag = new Transform();
     try
     {
         RequiredAttribute.Check(tag);
         Assert.Fail("Expected Exception");
     }
     catch (TagException Te)
     {
         Assert.That(Te.Message,
                     Is.EqualTo(TagException.MissingRequiredAttribute(typeof (Transform), "Doc", "Xslt").Message));
     }
     tag.Doc = new MockAttribute(new Constant("a"));
     tag.Xslt = new MockAttribute(new Constant("a"));
     RequiredAttribute.Check(tag);
 }
Exemplo n.º 2
0
 public void SimpleTransformWithParams()
 {
     var tag = new Transform();
     tag.Doc = new MockAttribute(new Property("xml"));
     tag.Xslt = new MockAttribute(new Constant(SAMPLE_XSLT_WITH_PARAMS));
     var param = new Param();
     param.Name = new MockAttribute(new Constant("testparam"));
     param.Body = new MockAttribute(new Constant("SharpTiles"));
     tag.AddNestedTag(param);
     Assert.That(tag.Evaluate(_model), Is.EqualTo(SAMPLE_HTML_WITH_PARAMS));
 }
Exemplo n.º 3
0
 public void TransformEmptyTransformVar()
 {
     var tag = new Transform();
     tag.Doc = new MockAttribute(new Property("xml"));
     tag.Xslt = new MockAttribute(new Property("noxslt"));
     Assert.That(tag.Evaluate(_model), Is.EqualTo(String.Empty));
 }
Exemplo n.º 4
0
 public void SimpleTransformAsString()
 {
     var tag = new Transform();
     tag.Doc = new MockAttribute(new Property("xml"));
     tag.Xslt = new MockAttribute(new Constant(SAMPLE_XSLT));
     Assert.That(tag.Evaluate(_model), Is.EqualTo(SAMPLE_HTML));
 }