Exemplo n.º 1
0
        public void GivenDataGridViewWithDataSource_WhenShown_ThenCurrentCellChangedFiredOnlyOnce()
        {
            // Given
            var count        = 0;
            var dataGridView = new EnhancedDataGridView
            {
                DataSource = new List <TestDataRow>
                {
                    new TestDataRow
                    {
                        A = 1.0,
                        B = 1.1
                    },
                    new TestDataRow
                    {
                        A = 2.0,
                        B = 2.1
                    }
                }
            };

            dataGridView.CurrentCellChanged += (s, e) => count++;

            // When
            WindowsFormsTestHelper.Show(dataGridView);

            // Then
            Assert.AreEqual(1, count);
        }
Exemplo n.º 2
0
        public void Constructor_DefaultValues()
        {
            // Call
            var dataGridView = new EnhancedDataGridView();

            // Assert
            Assert.IsInstanceOf <DataGridView>(dataGridView);
        }