Beispiel #1
0
        public void IInstanceTagDocumentationPropertyIsUsed()
        {
            var  tagDict = new Dictionary <int, TagDocumentation>();
            var  td      = new TagDocumentation(new ResourceKeyStack(bundle), new InstanceTagDocumentationOut(), new List <Func <ITag, TagDocumentation, bool> >(), tagDict);
            bool hasBody = false;

            Assert.That(td.Description.Value, Is.EqualTo("Hi"));
        }
Beispiel #2
0
        public void PropertyInTagsShouldBePresent()
        {
            var tagDict = new Dictionary <int, TagDocumentation>();
            var tag     = new TagDocumentation(new ResourceKeyStack(bundle), new Out(), new List <Func <ITag, TagDocumentation, bool> >(), tagDict);

            Assert.That(tag.Name, Is.EqualTo(new Out().TagName));
            Assert.That(tag.Properties, Is.Not.Null);
            Assert.That(tag.Properties.Count, Is.GreaterThan(0));
        }
 public void NonInternalPropertyIsIncluded()
 {
     var td = new TagDocumentation(new ResourceKeyStack(bundle), new Out(), new List<Func<ITag, TagDocumentation, bool>>());
     bool hasValue = false;
     foreach (PropertyDocumentation property in td.Properties)
     {
         hasValue |= property.Name.Equals("Value");
     }
     Assert.That(hasValue, Is.True);
 }
 public void InternalPropertyIsNotIncluded()
 {
     var td = new TagDocumentation(new ResourceKeyStack(bundle), new Out(), new List<Func<ITag, TagDocumentation, bool>>());
     bool hasBody = false;
     foreach (PropertyDocumentation property in td.Properties)
     {
         hasBody |= property.Name.Equals("Body");
     }
     Assert.That(hasBody, Is.False);
 }
Beispiel #5
0
        public void TagShouldReturnDescriptionKey()
        {
            var key = new ResourceKeyStack(bundle);

            key = key.BranchFor(new Core());
            var tagDict = new Dictionary <int, TagDocumentation>();
            var tag     = new TagDocumentation(key, new Out(), new List <Func <ITag, TagDocumentation, bool> >(), tagDict);

            Assert.That(tag.DescriptionKey, Is.EqualTo("description_Core_Out"));
        }
Beispiel #6
0
        public void NonInternalPropertyIsIncluded()
        {
            var  tagDict  = new Dictionary <int, TagDocumentation>();
            var  td       = new TagDocumentation(new ResourceKeyStack(bundle), new Out(), new List <Func <ITag, TagDocumentation, bool> >(), tagDict);
            bool hasValue = false;

            foreach (PropertyDocumentation property in td.Properties)
            {
                hasValue |= property.Name.Equals("Value");
            }
            Assert.That(hasValue, Is.True);
        }
Beispiel #7
0
 public static bool HandleHtmlTags(ITag tag, TagDocumentation documentation)
 {
     if (tag is HtmlHelperWrapperTag)
     {
         var htmlTag = (HtmlHelperWrapperTag)tag;
         var htmlHelper = new HtmlReflectionHelper(htmlTag.WrappedType, htmlTag.MethodName);
         foreach (var method in htmlHelper.AllMethods)
         {
             documentation.Methods.Add(new FunctionDocumentation("",documentation.MessagePath, new WrappedFunctionDocumentation(method)));
         }
         return true;
     }
     return false;
 }
 public void IInstanceTagDocumentationPropertyIsUsed()
 {
     var td = new TagDocumentation(new ResourceKeyStack(bundle), new InstanceTagDocumentationOut(), new List<Func<ITag, TagDocumentation, bool>>());
     bool hasBody = false;
     Assert.That(td.Description.Value, Is.EqualTo("Hi"));
 }