Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
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
{
[TestFixture]
public class LabelExtensionsTests
{
HtmlHelper<Person> html;
[SetUp]
public void SetUp()
{
html = new HtmlHelper<Person>();
}
[Test]
public void LabelFor_SimpleProperty_ForAttributeIsSameAsName()
{
MvcHtmlString result = html.LabelFor(p => p.First);
Assert.AreEqual(@"<label for=""First"">First</label>", result.ToHtmlString());
}
[Test]
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.