public void RenderAttributes_Password() { TestHtmlInputText it = new TestHtmlInputText("password"); it.MaxLength = 2; it.Size = 4; it.ID = "mono"; it.Value = "s3kr3t"; #if NET_2_0 // value is there, maybe because a new HtmlInputPassword class exists ? HtmlDiff.AssertAreEqual(" name=\"mono\" id=\"mono\" type=\"password\" maxlength=\"2\" size=\"4\" value=\"s3kr3t\" /", it.RenderAttributes(), "Render failed"); Assert.IsFalse(it.ViewStateValueChanged, "ViewStateValueChanged"); Assert.IsFalse(it.AttributeValueChanged, "AttributeValueChanged"); #else HtmlDiff.AssertAreEqual(" name=\"mono\" id=\"mono\" type=\"password\" maxlength=\"2\" size=\"4\" /", it.RenderAttributes(), "Render failed"); Assert.IsTrue(it.ViewStateValueChanged, "ViewStateValueChanged"); Assert.IsTrue(it.AttributeValueChanged, "AttributeValueChanged"); #endif Assert.IsNull(it.ViewStateNewValue, "ViewStateNewValue"); Assert.IsNull(it.AttributeNewValue, "AttributeNewValue"); }
public void RenderAttributes_Password () { TestHtmlInputText it = new TestHtmlInputText ("password"); it.MaxLength = 2; it.Size = 4; it.ID = "mono"; it.Value = "s3kr3t"; #if NET_2_0 // value is there, maybe because a new HtmlInputPassword class exists ? HtmlDiff.AssertAreEqual (" name=\"mono\" id=\"mono\" type=\"password\" maxlength=\"2\" size=\"4\" value=\"s3kr3t\" /", it.RenderAttributes (),"Render failed"); Assert.IsFalse (it.ViewStateValueChanged, "ViewStateValueChanged"); Assert.IsFalse (it.AttributeValueChanged, "AttributeValueChanged"); #else HtmlDiff.AssertAreEqual(" name=\"mono\" id=\"mono\" type=\"password\" maxlength=\"2\" size=\"4\" /", it.RenderAttributes(),"Render failed"); Assert.IsTrue (it.ViewStateValueChanged, "ViewStateValueChanged"); Assert.IsTrue (it.AttributeValueChanged, "AttributeValueChanged"); #endif Assert.IsNull (it.ViewStateNewValue, "ViewStateNewValue"); Assert.IsNull (it.AttributeNewValue, "AttributeNewValue"); }
public void RenderAttributes() { TestHtmlInputText it = new TestHtmlInputText(); it.MaxLength = 4; it.Size = 2; it.Name = "mono"; it.Value = "value"; Assert.AreEqual(" name type=\"text\" maxlength=\"4\" size=\"2\" value=\"value\" /", it.RenderAttributes()); }
public void RenderAttributes () { TestHtmlInputText it = new TestHtmlInputText (); it.MaxLength = 4; it.Size = 2; it.Name = "mono"; it.Value = "value"; Assert.AreEqual (" name type=\"text\" maxlength=\"4\" size=\"2\" value=\"value\" /", it.RenderAttributes ()); }