private void btnAddCustomer_Click(object sender, EventArgs e) { AddCustomerForm dialoge = new AddCustomerForm(); if (DialogResult.OK == dialoge.ShowDialog()) { Customer createdCust = dialoge.newCustomerreturn(); createdCust.ReadLastCustNum(customerList.Data()); customerList.AddNewCustomer(createdCust); } UpdateDataGrid(); }
public void CustomerList_AddCustomer_Pos() { try { // arrange Customer customer = new Customer("Flo", "Binder", "*****@*****.**"); CustomerList customerList = new CustomerList(); customerList.ReadCustomerList(); customer.ReadLastCustNum(customerList.Data()); //act customerList.AddNewCustomer(customer); } catch (Exception ex) { Assert.Fail(); return; } }