private static WireframeGenerator BufferH( WireframeGenerator gen, int level, int wordCount = 2, object htmlAttributes = null) => gen.Add( WireframeGenerator.GenerateHtmlIpsum($"h{level}", () => Lorem.GenerateWords(wordCount), htmlAttributes) );
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); }
public void CanGenerateValues() { var value = Lorem.GenerateWords(10); Assert.True(value.Length > 0); }
public IHtmlContent Words(int count) { var words = Lorem.GenerateWords(count); return(new HtmlString(words)); }