title: Raising the Paint event in NUintTestCases in Windows forms
body: <p>I am new to Windows forms and NUnit Test cases, I have custom control(DataGrid), I have to check how many times Paint event is raised while creating the control in NUnit test cases. But the Paint event is not raise, could you please suggest how can i raise the the Paint event?</p>
  
  <pre><code>    public void Grouping_CheckBottomForIndentCellMethod()
       {
           DataGrid dataGrid = new DataGrid();
           dataGrid.Size = new System.Drawing.Size(800, 500);
           dataGrid.AutoGenerateColumns = false;
           dataGrid.ItemsSource = (new OrderInfoRepositiory()).Orders;
           dataGrid.Columns.Add(new GridTextColumn() { HeaderText = "OrderID", MappingName = "OrderID" });
           dataGrid.Columns.Add(new GridTextColumn() { HeaderText = "CustomerID", MappingName = "CustomerID" });
           dataGrid.Columns.Add(new GridTextColumn() { HeaderText = "CustomerName", MappingName = "CustomerName" });
           dataGrid.Columns.Add(new GridTextColumn() { HeaderText = "Country", MappingName = "Country" });
           dataGrid.Columns.Add(new GridTextColumn() { HeaderText = "ShipCity", MappingName = "ShipCity" });
  
           dataGrid.Paint += dataGrid_Paint;
  
           dataGrid.Show();
  
  
           if (i != 1)
               Assert.Fail("PaintRaisedMultipleTimes");
       }
  
       void dataGrid_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
       {
           i++;
       }
  </code></pre>
  
  <p>Thanks in advance.</p>
  
  <p>Regards,
  Farjana Parveen Ayubb</p>