public void CleanProperties() { TestTableHeaderCell th = new TestTableHeaderCell(); #if NET_2_0 th.AbbreviatedText = "header"; Assert.AreEqual("header", th.AbbreviatedText, "AbbreviatedText"); th.AbbreviatedText = null; Assert.AreEqual(String.Empty, th.AbbreviatedText, "-AbbreviatedText"); Assert.AreEqual(0, th.StateBag.Count, "ViewState.Count-1"); th.CategoryText = new string[1] { "mono" }; Assert.AreEqual(1, th.CategoryText.Length, "CategoryText"); th.CategoryText = new string[0]; Assert.AreEqual(0, th.CategoryText.Length, "-CategoryText"); Assert.AreEqual(1, th.StateBag.Count, "ViewState.Count-1"); th.Scope = TableHeaderScope.Row; Assert.AreEqual(TableHeaderScope.Row, th.Scope, "Scope"); th.Scope = TableHeaderScope.NotSet; Assert.AreEqual(TableHeaderScope.NotSet, th.Scope, "-Scope"); Assert.AreEqual(2, th.StateBag.Count, "ViewState.Count-2"); #else Assert.AreEqual(0, th.StateBag.Count, "ViewState.Count-1"); #endif Assert.AreEqual(0, th.Attributes.Count, "Attributes.Count"); }
public void DefaultProperties () { TestTableHeaderCell th = new TestTableHeaderCell (); Assert.AreEqual (0, th.Attributes.Count, "Attributes.Count"); Assert.AreEqual (0, th.StateBag.Count, "ViewState.Count"); Assert.AreEqual (String.Empty, th.AbbreviatedText, "AbbreviatedText"); Assert.AreEqual (0, th.CategoryText.Length, "CategoryText"); Assert.AreEqual (TableHeaderScope.NotSet, th.Scope, "Scope"); Assert.AreEqual ("th", th.Tag, "TagName"); Assert.AreEqual (0, th.Attributes.Count, "Attributes.Count-2"); Assert.AreEqual (0, th.StateBag.Count, "ViewState.Count-2"); }
public void DefaultProperties() { TestTableHeaderCell th = new TestTableHeaderCell(); Assert.AreEqual(0, th.Attributes.Count, "Attributes.Count"); Assert.AreEqual(0, th.StateBag.Count, "ViewState.Count"); Assert.AreEqual(String.Empty, th.AbbreviatedText, "AbbreviatedText"); Assert.AreEqual(0, th.CategoryText.Length, "CategoryText"); Assert.AreEqual(TableHeaderScope.NotSet, th.Scope, "Scope"); Assert.AreEqual("th", th.Tag, "TagName"); Assert.AreEqual(0, th.Attributes.Count, "Attributes.Count-2"); Assert.AreEqual(0, th.StateBag.Count, "ViewState.Count-2"); }
public void NullProperties () { TestTableHeaderCell th = new TestTableHeaderCell (); th.AbbreviatedText = null; Assert.AreEqual (String.Empty, th.AbbreviatedText, "AbbreviatedText"); th.CategoryText = new string[0]; Assert.AreEqual (0, th.CategoryText.Length, "CategoryText"); Assert.AreEqual (1, th.StateBag.Count, "ViewState.Count-1"); th.Scope = TableHeaderScope.NotSet; Assert.AreEqual (TableHeaderScope.NotSet, th.Scope, "Scope"); Assert.AreEqual (2, th.StateBag.Count, "ViewState.Count-2"); Assert.AreEqual (0, th.Attributes.Count, "Attributes.Count"); }
public void NullProperties() { TestTableHeaderCell th = new TestTableHeaderCell(); th.AbbreviatedText = null; Assert.AreEqual(String.Empty, th.AbbreviatedText, "AbbreviatedText"); th.CategoryText = new string[0]; Assert.AreEqual(0, th.CategoryText.Length, "CategoryText"); Assert.AreEqual(1, th.StateBag.Count, "ViewState.Count-1"); th.Scope = TableHeaderScope.NotSet; Assert.AreEqual(TableHeaderScope.NotSet, th.Scope, "Scope"); Assert.AreEqual(2, th.StateBag.Count, "ViewState.Count-2"); Assert.AreEqual(0, th.Attributes.Count, "Attributes.Count"); }
public void Render() { TestTableHeaderCell th = new TestTableHeaderCell(); string s = th.Render(); Assert.AreEqual(AdjustLineEndings("<th></th>"), s, "empty/default"); #if NET_2_0 th.AbbreviatedText = "header"; s = th.Render(); Assert.AreEqual(AdjustLineEndings("<th abbr=\"header\"></th>"), s, "AbbreviatedText"); th.AbbreviatedText = null; th.CategoryText = new string[1] { "mono" }; s = th.Render(); Assert.AreEqual(AdjustLineEndings("<th axis=\"mono\"></th>"), s, "CategoryText-1"); th.CategoryText = new string[2] { "mono", "http://www.mono-project.com" }; s = th.Render(); Assert.AreEqual(AdjustLineEndings("<th axis=\"mono,http://www.mono-project.com\"></th>"), s, "CategoryText-2"); th.CategoryText = new string[3] { "mono", "http://www.mono-project.com", "," }; s = th.Render(); Assert.AreEqual(AdjustLineEndings("<th axis=\"mono,http://www.mono-project.com,,\"></th>"), s, "CategoryText-2"); th.CategoryText = new string[0]; s = th.Render(); Assert.AreEqual(AdjustLineEndings("<th></th>"), s, "CategoryText-2"); th.Scope = TableHeaderScope.Row; s = th.Render(); Assert.AreEqual(AdjustLineEndings("<th scope=\"row\"></th>"), s, "Row"); th.Scope = TableHeaderScope.Column; s = th.Render(); Assert.AreEqual(AdjustLineEndings("<th scope=\"column\"></th>"), s, "Column"); th.Scope = TableHeaderScope.NotSet; s = th.Render(); Assert.AreEqual(AdjustLineEndings("<th></th>"), s, "NotSet"); #endif th.Text = "test"; s = th.Render(); Assert.AreEqual(AdjustLineEndings("<th>test</th>"), s, "Text"); }
public void CleanProperties () { TestTableHeaderCell th = new TestTableHeaderCell (); #if NET_2_0 th.AbbreviatedText = "header"; Assert.AreEqual ("header", th.AbbreviatedText, "AbbreviatedText"); th.AbbreviatedText = null; Assert.AreEqual (String.Empty, th.AbbreviatedText, "-AbbreviatedText"); Assert.AreEqual (0, th.StateBag.Count, "ViewState.Count-1"); th.CategoryText = new string[1] { "mono" }; Assert.AreEqual (1, th.CategoryText.Length, "CategoryText"); th.CategoryText = new string[0]; Assert.AreEqual (0, th.CategoryText.Length, "-CategoryText"); Assert.AreEqual (1, th.StateBag.Count, "ViewState.Count-1"); th.Scope = TableHeaderScope.Row; Assert.AreEqual (TableHeaderScope.Row, th.Scope, "Scope"); th.Scope = TableHeaderScope.NotSet; Assert.AreEqual (TableHeaderScope.NotSet, th.Scope, "-Scope"); Assert.AreEqual (2, th.StateBag.Count, "ViewState.Count-2"); #else Assert.AreEqual (0, th.StateBag.Count, "ViewState.Count-1"); #endif Assert.AreEqual (0, th.Attributes.Count, "Attributes.Count"); }
public void Render () { TestTableHeaderCell th = new TestTableHeaderCell (); string s = th.Render (); Assert.AreEqual (AdjustLineEndings ("<th></th>"), s, "empty/default"); #if NET_2_0 th.AbbreviatedText = "header"; s = th.Render (); Assert.AreEqual (AdjustLineEndings ("<th abbr=\"header\"></th>"), s, "AbbreviatedText"); th.AbbreviatedText = null; th.CategoryText = new string[1] { "mono" }; s = th.Render (); Assert.AreEqual (AdjustLineEndings ("<th axis=\"mono\"></th>"), s, "CategoryText-1"); th.CategoryText = new string[2] { "mono", "http://www.mono-project.com" }; s = th.Render (); Assert.AreEqual (AdjustLineEndings ("<th axis=\"mono,http://www.mono-project.com\"></th>"), s, "CategoryText-2"); th.CategoryText = new string[3] { "mono", "http://www.mono-project.com", "," }; s = th.Render (); Assert.AreEqual (AdjustLineEndings ("<th axis=\"mono,http://www.mono-project.com,,\"></th>"), s, "CategoryText-2"); th.CategoryText = new string[0]; s = th.Render (); Assert.AreEqual (AdjustLineEndings ("<th></th>"), s, "CategoryText-2"); th.Scope = TableHeaderScope.Row; s = th.Render (); Assert.AreEqual (AdjustLineEndings ("<th scope=\"row\"></th>"), s, "Row"); th.Scope = TableHeaderScope.Column; s = th.Render (); Assert.AreEqual (AdjustLineEndings ("<th scope=\"column\"></th>"), s, "Column"); th.Scope = TableHeaderScope.NotSet; s = th.Render (); Assert.AreEqual (AdjustLineEndings ("<th></th>"), s, "NotSet"); #endif th.Text = "test"; s = th.Render (); Assert.AreEqual (AdjustLineEndings ("<th>test</th>"), s, "Text"); }