private void LoadGrid() { try { AMC objAMC = new AMC(); dataGridView1.DataSource = objAMC.GetData(@"C:\amc.json"); dataGridView1.Columns[2].Width = 200; dataGridView1.Columns[3].Width = 250; } catch (Exception ex) { label1.Text = ex.Message; label1.ForeColor = Color.Red; } }
public void TestData_Except() { AMC amc = new AMC(); Assert.Throws <System.IO.FileNotFoundException>(() => amc.GetData(@"C:\amc1.json")); }
public void TestData_Normal() { AMC amc = new AMC(); Assert.IsNotNull(amc.GetData(@"C:\amc.json")); }