Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

35 lines (28 sloc) 0.766 kB
using NUnit.Framework;
using ServiceStack.Html;
using ServiceStack.Tests.Html.Support.Types;
namespace ServiceStack.Tests.Html
public class LabelExtensionsTests
HtmlHelper<Person> html;
public void SetUp()
html = new HtmlHelper<Person>();
public void LabelFor_SimpleProperty_ForAttributeIsSameAsName()
MvcHtmlString result = html.LabelFor(p => p.First);
Assert.AreEqual(@"<label for=""First"">First</label>", result.ToHtmlString());
public void LabelFor_NestedProperty_ForAttributeReferencesElementIDWithUnderscores()
MvcHtmlString result = html.LabelFor(p => p.Home.City);
Assert.AreEqual(@"<label for=""Home_City"">City</label>", result.ToHtmlString());
Jump to Line
Something went wrong with that request. Please try again.