public void DefaultConstructor_CreatesColumnInstance() { // Call using (var column = new DataGridViewColorColumn()) { // Assert Assert.IsInstanceOf <DataGridViewColumn>(column); } }
public void CellTemplate_WithColorCell_CellTemplateSet() { // Setup using (var column = new DataGridViewColorColumn()) { var dataGridViewCell = new DataGridViewColorCell(); // Call column.CellTemplate = dataGridViewCell; // Assert Assert.AreSame(dataGridViewCell, column.CellTemplate); } }
public void CellTemplate_WithOtherCell_ThrowsArgumentException() { // Setup using (var column = new DataGridViewColorColumn()) using (var dataGridViewCell = new DataGridViewTextBoxCell()) { // Call TestDelegate test = () => column.CellTemplate = dataGridViewCell; // Assert var exception = TestHelper.AssertThrowsArgumentExceptionAndTestMessage <ArgumentException>( test, $"Given template must be of type {typeof(DataGridViewColorCell)}"); Assert.AreEqual("value", exception.ParamName); } }