예제 #1
0
 private static WireframeGenerator BufferH(
     WireframeGenerator gen,
     int level,
     int wordCount         = 2,
     object htmlAttributes = null) => gen.Add(
     WireframeGenerator.GenerateHtmlIpsum($"h{level}", () => Lorem.GenerateWords(wordCount), htmlAttributes)
     );
예제 #2
0
        private static IHtmlContent GenerateListHtmlIpsum(string outer, string inner, int listCount, bool links, object liAttributes, int wordCount, object ulAttributes)
        {
            TagBuilder element = new TagBuilder(outer);

            for (int i = 0; i < listCount; i++)
            {
                if (links)
                {
                    TagBuilder li = new TagBuilder(inner);
                    li.MergeAttributes(HtmlAttributeHelper.GetHtmlAttributeDictionaryOrNull(liAttributes));
                    li.InnerHtml.SetHtmlContent(WireframeGenerator.GenerateHtmlIpsum("a", () => Lorem.GenerateWords(wordCount), HtmlAttributeHelper.GetHtmlAttributeDictionaryOrNull(new { href = "#" })));
                    element.InnerHtml.AppendHtml(li);
                }
                else
                {
                    element.InnerHtml.AppendHtml(WireframeGenerator.GenerateHtmlIpsum(inner, () => Lorem.GenerateWords(wordCount), liAttributes));
                }
            }
            element.MergeAttributes(HtmlAttributeHelper.GetHtmlAttributeDictionaryOrNull(ulAttributes));

            return(element);
        }
예제 #3
0
        public void CanGenerateValues()
        {
            var value = Lorem.GenerateWords(10);

            Assert.True(value.Length > 0);
        }
예제 #4
0
        public IHtmlContent Words(int count)
        {
            var words = Lorem.GenerateWords(count);

            return(new HtmlString(words));
        }