public void HtmlTagFor_Expression_Constant() { var helper = new HtmlTagHelper <Model1>(); Assert.Throws <InvalidOperationException>( () => helper.HtmlTagFor(m => 1, "input")); }
public void HtmlTagFor_Expression_MethodCall() { var helper = new HtmlTagHelper <Model1>(); Assert.Throws <InvalidOperationException>( () => helper.HtmlTagFor(m => m.PropInt.ToString(), "input")); }
public void HtmlTagFor_Any() { var helper = new HtmlTagHelper <Model1>(); var propExpression = Expr((Model1 m) => m.PropInt); var tagName = "any"; var tag = helper.HtmlTagFor(propExpression, tagName); AssertValid(tag, tagName, "PropInt"); }
public void HtmlTagFor_Input_Value_Int() { var model = new Model1() { PropInt = 1 }; var helper = new HtmlTagHelper <Model1>(model); var propExpression = Expr((Model1 m) => m.PropInt); var tagName = "input"; var tag = helper.HtmlTagFor(propExpression, tagName); AssertValid(tag, tagName, "PropInt", value: model.PropInt); }