Esempio n. 1
0
        public void BoundField_SortExpression()
        {
            // Sorting enable = true , link button must be created
            PokerBoundField bf = new PokerBoundField();
            // Header text
            DataControlFieldCell cell = new DataControlFieldCell(null);

            bf.HeaderImageUrl = "";
            bf.SortExpression = "a";
            bf.HeaderText     = "sortbutton";
            bf.Initialize(true, new Control());            // _base._sortingenable set to true
            bf.InitializeCell(cell, DataControlCellType.Header, DataControlRowState.Edit, 1);
            if (cell.Controls [0] is Button)               // mono
            {
                Button lb = (Button)cell.Controls [0];
                Assert.AreEqual("Sort", lb.CommandName, "InitializeCellHeaderSortButtonCommand");
                Assert.AreEqual("a", lb.CommandArgument, "InitializeCellHeaderSortButtonArgument");
                Assert.AreEqual("sortbutton", lb.Text, "InitializeCellHeaderSortButtonText");
            }
            else if (cell.Controls [0] is LinkButton)               // .net
            {
                LinkButton lb = (LinkButton)cell.Controls [0];
                Assert.AreEqual("Sort", lb.CommandName, "InitializeCellHeaderSortButtonCommand");
                Assert.AreEqual("a", lb.CommandArgument, "InitializeCellHeaderSortButtonArgument");
                Assert.AreEqual("sortbutton", lb.Text, "InitializeCellHeaderSortButtonText");
            }
            else
            {
                Assert.Fail("Sort button does not created");
            }
        }
Esempio n. 2
0
        public void ImageField_Initialize()
        {
            Control control = new Control();

            control.ID = "test";
            PokerBoundField field  = new PokerBoundField();
            bool            result = field.Initialize(true, control);

            Assert.AreEqual(false, result, "Initialize");
            Assert.AreEqual("test", field.GetControl.ID, "InitializeControl");
        }
Esempio n. 3
0
        public void BoundField_Initialize()
        {
            // This method initilize to private fields in a base class DataControlField
            // Always return false
            PokerBoundField bf      = new PokerBoundField();
            Control         control = new Control();

            control.ID = "test";
            bool res = bf.Initialize(true, control);

            // Assert.AreEqual (false, res, "InitializeResult");
            Assert.AreEqual("test", bf.GetControl.ID, "InitializeControl");
        }
		public void BoundField_SortExpression () {
			// Sorting enable = true , link button must be created
			PokerBoundField bf = new PokerBoundField ();
			// Header text
			DataControlFieldCell cell = new DataControlFieldCell (null);

			bf.HeaderImageUrl = "";
			bf.SortExpression = "a";
			bf.HeaderText = "sortbutton";
			bf.Initialize (true, new Control ());    // _base._sortingenable set to true
			bf.InitializeCell (cell, DataControlCellType.Header, DataControlRowState.Edit, 1);
			if (cell.Controls [0] is Button) { // mono
				Button lb = (Button) cell.Controls [0];
				Assert.AreEqual ("Sort", lb.CommandName, "InitializeCellHeaderSortButtonCommand");
				Assert.AreEqual ("a", lb.CommandArgument, "InitializeCellHeaderSortButtonArgument");
				Assert.AreEqual ("sortbutton", lb.Text, "InitializeCellHeaderSortButtonText");

			}
			else if (cell.Controls [0] is LinkButton) { // .net
				LinkButton lb = (LinkButton) cell.Controls [0];
				Assert.AreEqual ("Sort", lb.CommandName, "InitializeCellHeaderSortButtonCommand");
				Assert.AreEqual ("a", lb.CommandArgument, "InitializeCellHeaderSortButtonArgument");
				Assert.AreEqual ("sortbutton", lb.Text, "InitializeCellHeaderSortButtonText");

			}
			else {
				Assert.Fail ("Sort button does not created");
			}
		}
		public void BoundField_Initialize () {
			// This method initilize to private fields in a base class DataControlField 
			// Always return false
			PokerBoundField bf = new PokerBoundField ();
			Control control = new Control ();
			control.ID = "test";
			bool res = bf.Initialize (true, control);
			// Assert.AreEqual (false, res, "InitializeResult");
			Assert.AreEqual ("test", bf.GetControl.ID, "InitializeControl");
		}
		public void ImageField_Initialize ()
		{
			Control control = new Control ();
			control.ID = "test";
			PokerBoundField field = new PokerBoundField ();
			bool result = field.Initialize (true, control);
			Assert.AreEqual (false, result, "Initialize");
			Assert.AreEqual ("test", field.GetControl.ID, "InitializeControl");
		}