public void DefaultProperties () { TestDataGridColumn d = new TestDataGridColumn (); TableItemStyle tis = d.FooterStyle; Assert.IsNotNull (tis, "FooterStyle"); Assert.AreEqual (tis.GetType (), typeof (TableItemStyle), "typeof FooterStyle"); Assert.AreEqual (SDColor.Empty, tis.BackColor, "FooterStyle.BackColor"); Assert.AreEqual (SDColor.Empty, tis.BorderColor, "FooterStyle.BorderColor"); Assert.AreEqual (BorderStyle.NotSet, tis.BorderStyle, "FooterStyle.BorderStyle"); Assert.AreEqual (Unit.Empty, tis.BorderWidth, "FooterStyle.BorderWidth"); Assert.IsNull (tis.Container, "FooterStyle.Container"); Assert.AreEqual (String.Empty, tis.CssClass, "FooterStyle.CssClass"); FontInfo fi = tis.Font; Assert.IsNotNull (fi, "FooterStyle.FontInfo"); Assert.IsFalse (fi.Bold, "FooterStyle.FontInfo.Bold"); Assert.IsFalse (fi.Italic, "FooterStyle.FontInfo.Italic"); Assert.AreEqual (String.Empty, fi.Name, "FooterStyle.FontInfo.Name"); Assert.AreEqual (0, fi.Names.Length, "FooterStyle.FontInfo.Names.Length"); Assert.IsFalse (fi.Overline, "FooterStyle.FontInfo.Overline"); Assert.IsNotNull (fi.Size, "FooterStyle.FontInfo.Size"); Assert.IsFalse (fi.Strikeout, "FooterStyle.FontInfo.Strikeout"); Assert.IsFalse (fi.Underline, "FooterStyle.FontInfo.Underline"); Assert.AreEqual (String.Empty, d.FooterText, "FooterText"); Assert.AreEqual (String.Empty, d.HeaderImageUrl, "HeaderImageUrl"); tis = d.HeaderStyle; Assert.IsNotNull (tis, "HeaderStyle"); Assert.AreEqual (tis.GetType (), typeof (TableItemStyle), "typeof HeaderStyle"); Assert.AreEqual (SDColor.Empty, tis.BackColor, "HeaderStyle.BackColor"); Assert.AreEqual (SDColor.Empty, tis.BorderColor, "HeaderStyle.BorderColor"); Assert.AreEqual (BorderStyle.NotSet, tis.BorderStyle, "HeaderStyle.BorderStyle"); Assert.AreEqual (Unit.Empty, tis.BorderWidth, "HeaderStyle.BorderWidth"); Assert.IsNull (tis.Container, "HeaderStyle.Container"); Assert.AreEqual (String.Empty, tis.CssClass, "HeaderStyle.CssClass"); fi = tis.Font; Assert.IsNotNull (fi, "HeaderStyle.FontInfo"); Assert.IsFalse (fi.Bold, "HeaderStyle.FontInfo.Bold"); Assert.IsFalse (fi.Italic, "HeaderStyle.FontInfo.Italic"); Assert.AreEqual (String.Empty, fi.Name, "HeaderStyle.FontInfo.Name"); Assert.AreEqual (0, fi.Names.Length, "HeaderStyle.FontInfo.Names.Length"); Assert.IsFalse (fi.Overline, "HeaderStyle.FontInfo.Overline"); Assert.IsNotNull (fi.Size, "HeaderStyle.FontInfo.Size"); Assert.IsFalse (fi.Strikeout, "HeaderStyle.FontInfo.Strikeout"); Assert.IsFalse (fi.Underline, "HeaderStyle.FontInfo.Underline"); Assert.AreEqual (String.Empty, d.HeaderText, "HeaderText"); tis = d.ItemStyle; Assert.IsNotNull (tis, "ItemStyle"); Assert.AreEqual (tis.GetType (), typeof (TableItemStyle), "typeof ItemStyle"); Assert.AreEqual (SDColor.Empty, tis.BackColor, "ItemStyle.BackColor"); Assert.AreEqual (SDColor.Empty, tis.BorderColor, "ItemStyle.BorderColor"); Assert.AreEqual (BorderStyle.NotSet, tis.BorderStyle, "ItemStyle.BorderStyle"); Assert.AreEqual (Unit.Empty, tis.BorderWidth, "ItemStyle.BorderWidth"); Assert.IsNull (tis.Container, "ItemStyle.Container"); Assert.AreEqual (String.Empty, tis.CssClass, "ItemStyle.CssClass"); fi = tis.Font; Assert.IsNotNull (fi, "ItemStyle.FontInfo"); Assert.IsFalse (fi.Bold, "ItemStyle.FontInfo.Bold"); Assert.IsFalse (fi.Italic, "ItemStyle.FontInfo.Italic"); Assert.AreEqual (String.Empty, fi.Name, "ItemStyle.FontInfo.Name"); Assert.AreEqual (0, fi.Names.Length, "ItemStyle.FontInfo.Names.Length"); Assert.IsFalse (fi.Overline, "ItemStyle.FontInfo.Overline"); Assert.IsNotNull (fi.Size, "ItemStyle.FontInfo.Size"); Assert.IsFalse (fi.Strikeout, "ItemStyle.FontInfo.Strikeout"); Assert.IsFalse (fi.Underline, "ItemStyle.FontInfo.Underline"); Assert.AreEqual (String.Empty, d.SortExpression, "SortExpression"); Assert.IsTrue (d.Visible, "Visible"); Assert.IsFalse (d.GetDesignMode (), "DesignMode"); Assert.IsNull (d.GetOwner (), "Owner"); Assert.AreEqual (0, d.GetViewState ().Count, "ViewState"); }
public void TestInitialize () { DataGrid grid = new DataGrid (); TestDataGridColumn d = new TestDataGridColumn (); /* Test DesignMode if I find a class that * implements ISite */ Assert.IsNull (d.GetOwner (), "Owner before Add"); grid.Columns.Add (d); Assert.AreEqual (grid, d.GetOwner (), "Owner after Add"); }