Ejemplo n.º 1
0
        public void CheckIncludeRequired()
        {
            var tag = new Include();
            try
            {
                RequiredAttribute.Check(tag);
                Assert.Fail("Expected exception");
            }
            catch (TagException Te)
            {
                Assert.That(Te.Message,
                            Is.EqualTo(TagException.MissingRequiredAttribute(typeof (Include), "File").Message));
            }

            tag.File =
                new TemplateAttribute(new ParsedTemplate(new FileBasedResourceLocator(),
                                                         new TextPart("SharpTags\\a.htm", null)));
            RequiredAttribute.Check(tag);
        }
Ejemplo n.º 2
0
 public void CheckReturnOfTemplate()
 {
     var tag = new Include
                   {
                       File = new TemplateAttribute(new ParsedTemplate(new FileBasedResourceLocator(), new TextPart("SharpTags\\a.htm", null)))
                   };
     tag.Factory=new FileLocatorFactory();
     Assert.That(tag.Evaluate(new TagModel(this)), Is.EqualTo("aa"));
 }