public void ListLaptops() { List <Laptop> laptops = null; IRepositorio rep = new RepositorioMySQL(); try { laptops = rep.List(); } catch (Exception ex) { } Assert.IsNotNull(laptops); }
private void ListLaptops() { IRepositorio rep = new RepositorioMySQL(); try { gridLaptops.DataSource = null; gridLaptops.DataSource = rep.List(); gridLaptops.Refresh(); } catch (Exception ex) { MessageBox.Show($"Ocorreu um erro: {ex.Message}"); } }