public void Should_render_href_when_item_is_disabled()
        {
            item.Url     = "http://www.microsoft.com/";
            item.Enabled = false;

            IHtmlNode tag = renderer.ItemInnerContentTag(item, false);

            Assert.True(tag.Attributes().ContainsKey("href"));
        }
Exemple #2
0
        public void Should_not_render_href_when_item_is_disabled()
        {
            item.Url     = "#";
            item.Enabled = false;

            IHtmlNode tag = renderer.ItemInnerContent(item);

            Assert.False(tag.Attributes().ContainsKey("href"));
        }
        public void CreateUpload_should_not_render_id()
        {
            const string id = "upload";

            upload.Name = id;

            IHtmlNode tag = builder.CreateUpload();

            tag.Attributes().ContainsKey("id").ShouldBeFalse();
        }
        public void Should_output_span_for_item_without_link()
        {
            item.Text = "text";
            item.Url  = "#";

            IHtmlNode tag = builder.ItemInnerContentTag(item, false);

            Assert.Equal(UIPrimitives.Link, tag.Attribute("class"));
            Assert.False(tag.Attributes().ContainsKey("href"));
            Assert.Equal("span", tag.TagName);
            Assert.Equal("text", tag.Children[0].InnerHtml);
        }
Exemple #5
0
        public void HiddenInputTag_does_not_output_name_attribute_for_unnamed_components()
        {
            var renderer = new ComboBoxHtmlBuilder(new EditorComboBox("FontFace", new List <DropDownItem>()
            {
                new DropDownItem {
                    Text = "Arial", Value = "Arial,Verdana,sans-serif"
                }
            }, TestHelper.CreateViewContext()));

            IHtmlNode tag = renderer.HiddenInputTag();

            Assert.False(tag.Attributes().ContainsKey("name"));
        }
Exemple #6
0
        protected virtual void AddAttributes(IHtmlNode link)
        {
            if (Url.HasValue())
            {
                link.Attribute("href", Url);
            }

            if (Target.HasValue())
            {
                link.Attribute("data-target", Target);
            }

            if (Rel != MobileButtonRel.None)
            {
                link.Attribute("data-rel", Rel.ToString().ToLower());

                if (Rel == MobileButtonRel.ActionSheet)
                {
                    link.Attribute("data-actionsheet-context", ActionsheetContext);
                }
            }

            link.Attributes(LinkHtmlAttributes);
        }
 protected override void ApplyDecoration(IHtmlNode htmlNode)
 {
     htmlNode.Attributes(CurrentGridItem.HtmlAttributes);
 }
        public void CreateFileInput_should_not_set_multiple()
        {
            IHtmlNode tag = builder.CreateFileInput();

            tag.Attributes().ContainsKey("multiple").ShouldBeFalse();
        }
        protected virtual void AddAttributes(IHtmlNode link)
        {
            if (Url.HasValue())
            {
                link.Attribute("href", Url);
            }

            if (Target.HasValue())
            {
                link.Attribute("data-target", Target);
            }

            if (Rel != MobileButtonRel.None)
            {
                link.Attribute("data-rel", Rel.ToString().ToLower());

                if (Rel == MobileButtonRel.ActionSheet)
                {
                    link.Attribute("data-actionsheet-context", ActionsheetContext);
                }
            }

            link.Attributes(LinkHtmlAttributes);
        }
 protected override void ApplyDecoration(IHtmlNode htmlNode)
 {
     htmlNode.Attributes(CurrentGridItem.HtmlAttributes);
 }