Example #1
0
        public void CreateControlStyle()
        {
            TestTable t = new TestTable();

            t.BackImageUrl    = imageUrl;
            t.CellPadding     = 1;
            t.CellSpacing     = 2;
            t.GridLines       = GridLines.Horizontal;
            t.HorizontalAlign = HorizontalAlign.Left;

            TableStyle ts = (TableStyle)t.GetStyle();

            // is it live ?
            ts.BackImageUrl = "mono";
            Assert.AreEqual("mono", t.BackImageUrl, "BackImageUrl-2");
            ts.CellPadding = Int32.MaxValue;
            Assert.AreEqual(Int32.MaxValue, t.CellPadding, "CellPadding-2");
            ts.CellSpacing = 0;
            Assert.AreEqual(0, t.CellSpacing, "CellSpacing-2");
            ts.GridLines = GridLines.Vertical;
            Assert.AreEqual(GridLines.Vertical, t.GridLines, "GridLines-2");
            ts.HorizontalAlign = HorizontalAlign.Right;
            Assert.AreEqual(HorizontalAlign.Right, t.HorizontalAlign, "HorizontalAlign-2");
        }
		public void CreateControlStyle ()
		{
			TestTable t = new TestTable ();
			t.BackImageUrl = imageUrl;
			t.CellPadding = 1;
			t.CellSpacing = 2;
			t.GridLines = GridLines.Horizontal;
			t.HorizontalAlign = HorizontalAlign.Left;

			TableStyle ts = (TableStyle)t.GetStyle ();
			// is it live ?
			ts.BackImageUrl = "mono";
			Assert.AreEqual ("mono", t.BackImageUrl, "BackImageUrl-2");
			ts.CellPadding = Int32.MaxValue;
			Assert.AreEqual (Int32.MaxValue, t.CellPadding, "CellPadding-2");
			ts.CellSpacing = 0;
			Assert.AreEqual (0, t.CellSpacing, "CellSpacing-2");
			ts.GridLines = GridLines.Vertical;
			Assert.AreEqual (GridLines.Vertical, t.GridLines, "GridLines-2");
			ts.HorizontalAlign = HorizontalAlign.Right;
			Assert.AreEqual (HorizontalAlign.Right, t.HorizontalAlign, "HorizontalAlign-2");
		}