public void Test_CellTemplateIsNumericUpDownCell() { //---------------Set up test pack------------------- //---------------Assert Precondition---------------- //---------------Execute Test ---------------------- DataGridViewNumericUpDownColumn dtColumn = new DataGridViewNumericUpDownColumn(); //---------------Test Result ----------------------- Assert.IsInstanceOf(typeof(NumericUpDownCell), dtColumn.CellTemplate); }
public void Test_SetCellTemplate() { //---------------Set up test pack------------------- DataGridViewNumericUpDownColumn dtColumn = new DataGridViewNumericUpDownColumn(); NumericUpDownCell NumericUpDownCell = new NumericUpDownCell(); //---------------Assert Precondition---------------- Assert.AreNotSame(NumericUpDownCell, dtColumn.CellTemplate); //---------------Execute Test ---------------------- dtColumn.CellTemplate = NumericUpDownCell; //---------------Test Result ----------------------- Assert.AreSame(NumericUpDownCell, dtColumn.CellTemplate); }
public void Test_SetCellTemplate_MustBeNumericUpDownCell() { //---------------Set up test pack------------------- DataGridViewNumericUpDownColumn dtColumn = new DataGridViewNumericUpDownColumn(); //---------------Assert Precondition---------------- //---------------Execute Test ---------------------- bool errorThrown = false; try { dtColumn.CellTemplate = new System.Windows.Forms.DataGridViewCheckBoxCell(); } catch (InvalidCastException) { errorThrown = true; } //---------------Test Result ----------------------- Assert.IsTrue(errorThrown, "Cell Template must be type of NumericUpDownCell"); }
///<summary> /// Initialises the DataGridView NumericUpDown Column with the windows implementation /// of the DataGridViewNumericUpDownColumn to wrap for this implementation. ///</summary> ///<param name="dataGridViewColumn">The DataGridViewNumericUpDownColumn to wrap</param> public DataGridViewNumericUpDownColumnWin(DataGridViewNumericUpDownColumn dataGridViewColumn) : base(dataGridViewColumn) { }
///<summary> /// Initialises the DataGridView NumericUpDown Column with the windows implementation /// of the DataGridViewNumericUpDownColumn to wrap for this implementation. ///</summary> ///<param name="dataGridViewColumn">The DataGridViewNumericUpDownColumn to wrap</param> public DataGridViewNumericUpDownColumnWin(DataGridViewNumericUpDownColumn dataGridViewColumn) : base(dataGridViewColumn) { }