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); }
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)); }
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)); }
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)); }