Ejemplo n.º 1
0
		public void CleanProperties ()
		{
			TestDataGridColumn d = new TestDataGridColumn ();

			d.FooterText = "*footer-text*";
			Assert.AreEqual ("*footer-text*", d.FooterText, "FooterText set");
			d.HeaderImageUrl = "*header-image-url*";
			Assert.AreEqual ("*header-image-url*", d.HeaderImageUrl, "HeaderImageUrl set");
			d.HeaderText = "*header-text*";
			Assert.AreEqual ("*header-text*", d.HeaderText, "HeaderText set");
			d.SortExpression = "*sort-expression*";
			Assert.AreEqual ("*sort-expression*", d.SortExpression, "SortExpression set");
			d.Visible = true;
			Assert.IsTrue (d.Visible, "Visible set");
			
			Assert.AreEqual (5, d.GetViewState().Count, "ViewState.Count");

			d.FooterText = null;
			d.HeaderImageUrl = null;
			d.HeaderText = null;
			d.SortExpression = null;
			d.Visible = false;

			/* Visible remains in the ViewState */
			Assert.AreEqual (1, d.GetViewState ().Count, "ViewState.Count after clear");
		}
Ejemplo n.º 2
0
		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");
		}
Ejemplo n.º 3
0
		public void NullProperties ()
		{
			TestDataGridColumn d = new TestDataGridColumn ();
			
			d.FooterText = null;
			Assert.AreEqual (String.Empty, d.FooterText, "FooterText");
			d.HeaderImageUrl = null;
			Assert.AreEqual (String.Empty, d.HeaderImageUrl, "HeaderImageUrl");
			d.HeaderText = null;
			Assert.AreEqual (String.Empty, d.HeaderText, "HeaderText");
			d.SortExpression = null;
			Assert.AreEqual (String.Empty, d.SortExpression, "SortExpression");
			d.Visible = false;
			Assert.IsFalse (d.Visible, "Visible");
			
			/* Visible remains in the ViewState */
			Assert.AreEqual (1, d.GetViewState ().Count, "ViewState.Count");
		}