public void CleanProperties() { TestHtmlTextArea ta = new TestHtmlTextArea(); ta.Cols = 1; Assert.AreEqual(1, ta.Cols, "Cols"); ta.Name = "name"; Assert.IsNull(ta.Name, "Name"); ta.Rows = 2; Assert.AreEqual(2, ta.Rows, "Rows"); ta.Value = "value"; Assert.AreEqual("value", ta.Value, "Value"); Assert.AreEqual(3, ta.Attributes.Count, "3"); Assert.AreEqual(3, ta.StateBag.Count, "StateBag.Count=3"); ta.Cols = -1; Assert.AreEqual(-1, ta.Cols, "-Cols"); ta.Name = null; Assert.IsNull(ta.Name, "-Name"); ta.Rows = -1; Assert.AreEqual(-1, ta.Rows, "Rows"); ta.Value = null; Assert.AreEqual(String.Empty, ta.Value, "-Value"); Assert.AreEqual(0, ta.Attributes.Count, "0"); Assert.AreEqual(0, ta.StateBag.Count, "StateBag.Count=0"); }
public void IPostBackDataHandler_LoadPostData_NullCollection() { TestHtmlTextArea ta = new TestHtmlTextArea(); IPostBackDataHandler pbdh = (ta as IPostBackDataHandler); pbdh.LoadPostData("id1", null); }
public void RaisePostBackEvent() { TestHtmlTextArea ta = new TestHtmlTextArea(); ta.ServerChange += new EventHandler(ServerChange); serverChange = false; ta.Raise(); Assert.IsTrue(serverChange, "ServerClick"); }
public void IPostBackDataHandler_RaisePostBackEvent() { TestHtmlTextArea ta = new TestHtmlTextArea(); ta.ServerChange += new EventHandler(ServerChange); IPostBackDataHandler pbdh = (ta as IPostBackDataHandler); serverChange = false; pbdh.RaisePostDataChangedEvent(); Assert.IsTrue(serverChange, "ServerChange"); }
[Category("NotDotNet")] // MS throws a NullReferenceException here public void LoadPostData_WrongId() { TestHtmlTextArea ta = new TestHtmlTextArea(); ta.ID = "id1"; NameValueCollection nvc = new NameValueCollection(); nvc.Add("id1", "mono"); Assert.IsFalse(ta.LoadPost("id2", nvc), "LoadPostData"); Assert.AreEqual(String.Empty, ta.Value, "Value"); }
public void LoadPostData() { TestHtmlTextArea ta = new TestHtmlTextArea(); ta.ID = "id1"; NameValueCollection nvc = new NameValueCollection(); nvc.Add("id1", "mono"); Assert.IsTrue(ta.LoadPost("id1", nvc), "LoadPostData"); Assert.AreEqual("mono", ta.Value, "Value"); }
[Category("NotDotNet")] // MS throws a NullReferenceException here public void IPostBackDataHandler_LoadPostData_IdNull() { TestHtmlTextArea ta = new TestHtmlTextArea(); ta.ID = "id1"; IPostBackDataHandler pbdh = (ta as IPostBackDataHandler); NameValueCollection nvc = new NameValueCollection(); nvc.Add("id1", "mono"); Assert.IsFalse(pbdh.LoadPostData(null, new NameValueCollection())); Assert.AreEqual(String.Empty, ta.Value, "Value"); }
public void IPostBackDataHandler_LoadPostData() { TestHtmlTextArea ta = new TestHtmlTextArea(); ta.ID = "id1"; IPostBackDataHandler pbdh = (ta as IPostBackDataHandler); NameValueCollection nvc = new NameValueCollection(); nvc.Add("id1", "mono"); Assert.IsTrue(pbdh.LoadPostData("id1", nvc), "LoadPostData"); Assert.AreEqual("mono", ta.Value, "Value"); }
public void RenderAttributes() { TestHtmlTextArea ta = new TestHtmlTextArea(); ta.Cols = 4; ta.Rows = 2; ta.Name = "mono"; ta.Value = "value"; // value is out HtmlDiff.AssertAreEqual("<dummy name cols=\"4\" rows=\"2\" />", ta.RenderAttributes(), "RenderAttributes failed #1"); ta.ID = "go"; HtmlDiff.AssertAreEqual("<dummy name=\"go\" id=\"go\" cols=\"4\" rows=\"2\" />", ta.RenderAttributes(), "RenderAttributes failed #2"); }
public void Render() { TestHtmlTextArea ta = new TestHtmlTextArea(); ta.Cols = 4; ta.Rows = 2; ta.Name = "mono"; ta.Value = "value"; // value is out HtmlDiff.AssertAreEqual("<textarea name cols=\"4\" rows=\"2\">value</textarea>", ta.Render(), "Render #1"); ta.ID = "go"; HtmlDiff.AssertAreEqual("<textarea name=\"go\" id=\"go\" cols=\"4\" rows=\"2\">value</textarea>", ta.Render(), "Render #2"); }
public void DefaultProperties () { TestHtmlTextArea ta = new TestHtmlTextArea (); Assert.AreEqual (0, ta.Attributes.Count, "Attributes.Count"); Assert.AreEqual (0, ta.StateBag.Count, "StateBag.Count"); Assert.AreEqual (-1, ta.Cols, "Cols"); Assert.IsNull (ta.Name, "Name"); Assert.AreEqual (-1, ta.Rows, "Rows"); Assert.AreEqual (String.Empty, ta.Value, "Value"); Assert.AreEqual ("textarea", ta.TagName, "TagName"); Assert.AreEqual (0, ta.Attributes.Count, "Attributes.Count-2"); Assert.AreEqual (0, ta.StateBag.Count, "StateBag.Count-2"); }
public void NullProperties() { TestHtmlTextArea ta = new TestHtmlTextArea(); ta.Cols = -1; Assert.AreEqual(-1, ta.Cols, "Cols"); ta.Name = null; Assert.IsNull(ta.Name, "Name"); ta.Rows = -1; Assert.AreEqual(-1, ta.Rows, "Rows"); ta.Value = null; Assert.AreEqual(String.Empty, ta.Value, "Value"); Assert.AreEqual(0, ta.Attributes.Count, "Attributes.Count"); Assert.AreEqual(0, ta.StateBag.Count, "StateBag.Count"); }
public void DefaultProperties() { TestHtmlTextArea ta = new TestHtmlTextArea(); Assert.AreEqual(0, ta.Attributes.Count, "Attributes.Count"); Assert.AreEqual(0, ta.StateBag.Count, "StateBag.Count"); Assert.AreEqual(-1, ta.Cols, "Cols"); Assert.IsNull(ta.Name, "Name"); Assert.AreEqual(-1, ta.Rows, "Rows"); Assert.AreEqual(String.Empty, ta.Value, "Value"); Assert.AreEqual("textarea", ta.TagName, "TagName"); Assert.AreEqual(0, ta.Attributes.Count, "Attributes.Count-2"); Assert.AreEqual(0, ta.StateBag.Count, "StateBag.Count-2"); }
[Category("NotDotNet")] // Implementation details changes : Control name will diffrent. public void RenderName1() { UserControl ctrl = new UserControl(); ctrl.ID = "UC"; Page page = new Page(); page.EnableEventValidation = false; TestHtmlTextArea ta = new TestHtmlTextArea(); page.Controls.Add(ctrl); ctrl.Controls.Add(ta); ta.Name = "mono"; ta.ID = "go"; string expected = "<dummy name=\"UC$go\" id=\"UC_go\" />"; Assert.AreEqual(expected, ta.RenderAttributes()); }
public void Value() { TestHtmlTextArea ta = new TestHtmlTextArea(); Assert.AreEqual(0, ta.Attributes.Count, "0"); Assert.AreEqual(0, ta.StateBag.Count, "StateBag.Count=0"); ta.Value = "value"; Assert.AreEqual("value", ta.Value, "Value"); Assert.AreEqual(1, ta.Attributes.Count, "1"); Assert.AreEqual(1, ta.StateBag.Count, "StateBag.Count=1"); // however it's not in attributes Assert.IsNull(ta.Attributes["value"], "Attributes"); // but in InnerText and InnerHtml Assert.AreEqual("value", ta.InnerText, "InnerText"); Assert.AreEqual("value", ta.InnerHtml, "InnerHtml"); // the later is kept in the attributes Assert.IsNull(ta.Attributes["innertext"], "Attributes-InnerText"); Assert.AreEqual("value", ta.Attributes["innerhtml"], "Attributes-InnerHtml"); }
public void AddParsedSubObject_DataBoundLiteralControl () { TestHtmlTextArea ta = new TestHtmlTextArea (); ta.PublicAddParsedSubObject (new DataBoundLiteralControl (1,1)); }
public void AddParsedSubObject_DataBoundLiteralControl() { TestHtmlTextArea ta = new TestHtmlTextArea(); ta.PublicAddParsedSubObject(new DataBoundLiteralControl(1, 1)); }
public void AddParsedSubObject_LiteralControl() { TestHtmlTextArea ta = new TestHtmlTextArea(); ta.PublicAddParsedSubObject(new LiteralControl()); }
[Category ("NotDotNet")] // MS throws a NullReferenceException here public void LoadPostData_WrongId () { TestHtmlTextArea ta = new TestHtmlTextArea (); ta.ID = "id1"; NameValueCollection nvc = new NameValueCollection (); nvc.Add ("id1", "mono"); Assert.IsFalse (ta.LoadPost ("id2", nvc), "LoadPostData"); Assert.AreEqual (String.Empty, ta.Value, "Value"); }
public void RenderAttributes () { TestHtmlTextArea ta = new TestHtmlTextArea (); ta.Cols = 4; ta.Rows = 2; ta.Name = "mono"; ta.Value = "value"; // value is out HtmlDiff.AssertAreEqual ("<dummy name cols=\"4\" rows=\"2\" />", ta.RenderAttributes (), "RenderAttributes failed #1"); ta.ID = "go"; HtmlDiff.AssertAreEqual ("<dummy name=\"go\" id=\"go\" cols=\"4\" rows=\"2\" />", ta.RenderAttributes (), "RenderAttributes failed #2"); }
public void LoadPostData_NullCollection() { TestHtmlTextArea ta = new TestHtmlTextArea(); ta.LoadPost("id1", null); }
[NUnit.Framework.Category ("NotWorking")] // Mono throw HttpException public void AddParsedSubObject_Null () { TestHtmlTextArea ta = new TestHtmlTextArea (); ta.PublicAddParsedSubObject (null); }
[Category ("NotDotNet")] // MS throws a NullReferenceException here public void IPostBackDataHandler_LoadPostData_IdNull () { TestHtmlTextArea ta = new TestHtmlTextArea (); ta.ID = "id1"; IPostBackDataHandler pbdh = (ta as IPostBackDataHandler); NameValueCollection nvc = new NameValueCollection (); nvc.Add ("id1", "mono"); Assert.IsFalse (pbdh.LoadPostData (null, new NameValueCollection ())); Assert.AreEqual (String.Empty, ta.Value, "Value"); }
public void Value () { TestHtmlTextArea ta = new TestHtmlTextArea (); Assert.AreEqual (0, ta.Attributes.Count, "0"); Assert.AreEqual (0, ta.StateBag.Count, "StateBag.Count=0"); ta.Value = "value"; Assert.AreEqual ("value", ta.Value, "Value"); Assert.AreEqual (1, ta.Attributes.Count, "1"); Assert.AreEqual (1, ta.StateBag.Count, "StateBag.Count=1"); // however it's not in attributes Assert.IsNull (ta.Attributes["value"], "Attributes"); // but in InnerText and InnerHtml Assert.AreEqual ("value", ta.InnerText, "InnerText"); Assert.AreEqual ("value", ta.InnerHtml, "InnerHtml"); // the later is kept in the attributes Assert.IsNull (ta.Attributes["innertext"], "Attributes-InnerText"); Assert.AreEqual ("value", ta.Attributes["innerhtml"], "Attributes-InnerHtml"); }
public void IPostBackDataHandler_LoadPostData () { TestHtmlTextArea ta = new TestHtmlTextArea (); ta.ID = "id1"; IPostBackDataHandler pbdh = (ta as IPostBackDataHandler); NameValueCollection nvc = new NameValueCollection (); nvc.Add ("id1", "mono"); Assert.IsTrue (pbdh.LoadPostData ("id1", nvc), "LoadPostData"); Assert.AreEqual ("mono", ta.Value, "Value"); }
public void NullProperties () { TestHtmlTextArea ta = new TestHtmlTextArea (); ta.Cols = -1; Assert.AreEqual (-1, ta.Cols, "Cols"); ta.Name = null; Assert.IsNull (ta.Name, "Name"); ta.Rows = -1; Assert.AreEqual (-1, ta.Rows, "Rows"); ta.Value = null; Assert.AreEqual (String.Empty, ta.Value, "Value"); Assert.AreEqual (0, ta.Attributes.Count, "Attributes.Count"); Assert.AreEqual (0, ta.StateBag.Count, "StateBag.Count"); }
public void RaisePostBackEvent () { TestHtmlTextArea ta = new TestHtmlTextArea (); ta.ServerChange += new EventHandler (ServerChange); serverChange = false; ta.Raise (); Assert.IsTrue (serverChange, "ServerClick"); }
public void LoadPostData () { TestHtmlTextArea ta = new TestHtmlTextArea (); ta.ID = "id1"; NameValueCollection nvc = new NameValueCollection (); nvc.Add ("id1", "mono"); Assert.IsTrue (ta.LoadPost ("id1", nvc), "LoadPostData"); Assert.AreEqual ("mono", ta.Value, "Value"); }
public void AddParsedSubObject_LiteralControl () { TestHtmlTextArea ta = new TestHtmlTextArea (); ta.PublicAddParsedSubObject (new LiteralControl ()); }
public void IPostBackDataHandler_LoadPostData_NullCollection () { TestHtmlTextArea ta = new TestHtmlTextArea (); IPostBackDataHandler pbdh = (ta as IPostBackDataHandler); pbdh.LoadPostData ("id1", null); }
public void AddParsedSubObject_WrongType () { TestHtmlTextArea ta = new TestHtmlTextArea (); ta.PublicAddParsedSubObject (this); }
public void IPostBackDataHandler_RaisePostBackEvent () { TestHtmlTextArea ta = new TestHtmlTextArea (); ta.ServerChange += new EventHandler (ServerChange); IPostBackDataHandler pbdh = (ta as IPostBackDataHandler); serverChange = false; pbdh.RaisePostDataChangedEvent (); Assert.IsTrue (serverChange, "ServerChange"); }
public void Render () { TestHtmlTextArea ta = new TestHtmlTextArea (); ta.Cols = 4; ta.Rows = 2; ta.Name = "mono"; ta.Value = "value"; // value is out HtmlDiff.AssertAreEqual ("<textarea name cols=\"4\" rows=\"2\">value</textarea>", ta.Render (),"Render #1"); ta.ID = "go"; HtmlDiff.AssertAreEqual ("<textarea name=\"go\" id=\"go\" cols=\"4\" rows=\"2\">value</textarea>", ta.Render (),"Render #2"); }
[NUnit.Framework.Category("NotWorking")] // Mono throw HttpException public void AddParsedSubObject_Null() { TestHtmlTextArea ta = new TestHtmlTextArea(); ta.PublicAddParsedSubObject(null); }
[Category ("NotDotNet")] // Implementation details changes : Control name will diffrent. public void RenderName1 () { UserControl ctrl = new UserControl (); ctrl.ID = "UC"; Page page = new Page (); page.EnableEventValidation = false; TestHtmlTextArea ta = new TestHtmlTextArea (); page.Controls.Add (ctrl); ctrl.Controls.Add (ta); ta.Name = "mono"; ta.ID = "go"; string expected = "<dummy name=\"UC$go\" id=\"UC_go\" />"; Assert.AreEqual (expected, ta.RenderAttributes ()); }
public void AddParsedSubObject_WrongType() { TestHtmlTextArea ta = new TestHtmlTextArea(); ta.PublicAddParsedSubObject(this); }
public void CleanProperties () { TestHtmlTextArea ta = new TestHtmlTextArea (); ta.Cols = 1; Assert.AreEqual (1, ta.Cols, "Cols"); ta.Name = "name"; Assert.IsNull (ta.Name, "Name"); ta.Rows = 2; Assert.AreEqual (2, ta.Rows, "Rows"); ta.Value = "value"; Assert.AreEqual ("value", ta.Value, "Value"); Assert.AreEqual (3, ta.Attributes.Count, "3"); Assert.AreEqual (3, ta.StateBag.Count, "StateBag.Count=3"); ta.Cols = -1; Assert.AreEqual (-1, ta.Cols, "-Cols"); ta.Name = null; Assert.IsNull (ta.Name, "-Name"); ta.Rows = -1; Assert.AreEqual (-1, ta.Rows, "Rows"); ta.Value = null; Assert.AreEqual (String.Empty, ta.Value, "-Value"); Assert.AreEqual (0, ta.Attributes.Count, "0"); Assert.AreEqual (0, ta.StateBag.Count, "StateBag.Count=0"); }
public void LoadPostData_NullCollection () { TestHtmlTextArea ta = new TestHtmlTextArea (); ta.LoadPost ("id1", null); }