private void cmbxDept_SelectedIndexChanged(object sender, EventArgs e) { int Res = ValidateDeptName(cmbxDept.Text); dtgvEmpDtls.DataSource = null; dtgvEmpDtls.Rows.Clear(); dtgvEmpDtls.Columns.Clear(); dtgvEmpDtls.Refresh(); if (Res == 1) { Businessobj = new BusinessViewEmpDtls(); try { dt1 = Businessobj.BusinessFillEmpDtls(cmbxDept.Text); } catch (Exception exception) { throw exception; } if (dt1.Rows.Count > 0) { dtgvEmpDtls.DataSource = dt1; dtgvEmpDtls.Refresh(); } else { MessageBox.Show("No Record Found!"); } } }
public void TestBusinessViewEmpDtlsWithNullDeptName() { Assert.ThrowsException <ArgumentNullException>(() => objBusinessViewEmpDtls.BusinessFillEmpDtls(stringVal[0])); }