You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public static HtmlTag Text(this HtmlTag tag, StringToken token)
{
return tag.Text(token == null ? string.Empty : token.ToString());
}
public static HtmlTag Attr(this HtmlTag tag, string attName, StringToken token)
{
return tag.Attr(attName, token.ToString());
}
public static T TextIfEmpty<T>(this T tag, StringToken token) where T : HtmlTag
{
return tag.TextIfEmpty(token.ToString());
}
/// <summary>
/// Just returns the localized header text for a property of the view model
/// </summary>
/// <typeparam name = "T"></typeparam>
/// <param name = "page"></param>
/// <param name = "expression"></param>
/// <returns></returns>
public static string HeaderText<T>(this IFubuPage<T> page, Expression<Func<T, object>> expression)
where T : class
{
return LocalizationManager.GetHeader(expression);
}
The text was updated successfully, but these errors were encountered:
[Test]
public void set_localized_tag_text_by_string_token()
{
var token = StringToken.FromKeyString("KEY", "the text of this string token");
new HtmlTag("a").Text(token)
.Text().ShouldEqual(token.ToString());
}
[Test]
public void set_localized_attr_value_by_string_token()
{
var token = StringToken.FromKeyString("KEY", "the text of this string token");
new HtmlTag("span").Attr("title", token)
.Attr("title").ShouldEqual(token.ToString());
}
[Test]
public void set_the_text_by_localized_StringToken()
{
var token = StringToken.FromKeyString("KEY", "the localized string");
new HtmlTag("div").TextIfEmpty(token)
.Text().ShouldEqual(token.ToString());
}
The text was updated successfully, but these errors were encountered: