public void ForIsValidAtLevel1() { var model = new TestModel(); var html = this.GetHtmlHeper <TestModel>(model); var result = SrkHtmlExtensions.DescriptionFor(html, m => m.Description2); Assert.AreEqual("<span data-for=\"Description2\">Desc a2a</span>", result.ToString().NullIfEmpty()); }
public void AcceptsHtmlAttributes() { var model = new TestModel(); var html = this.GetHtmlHeper <TestModel>(model); var result = SrkHtmlExtensions.DescriptionFor(html, m => m.Description2, new { attr1 = "value", }); Assert.AreEqual("<span attr1=\"value\" data-for=\"Description2\">Desc a2a</span>", result.ToString().NullIfEmpty()); }
public void EmptyDescriptionReturnsEmptyString() { var model = new TestModel(); var html = this.GetHtmlHeper <TestModel>(model); var result = SrkHtmlExtensions.DescriptionFor(html, m => m.Description); Assert.IsNull(result.ToString().NullIfEmpty()); }