static void TestCustomerListCount() { CustomerList cList = new CustomerList(); cList.Fill(); Console.WriteLine("Expecting 1 " + cList.Count); }
static void TestCustomerListFill() { CustomerList cList = new CustomerList(); cList.Fill(); Console.WriteLine("Testing Fill"); Console.WriteLine("Expecting list of customers:\n" + cList); Console.WriteLine(); }
static void TestCustomerListIndexer() { // test fails before I add equals to customer CustomerList list = new CustomerList(); Customer c1 = new Customer(1, "*****@*****.**", "firstname", "lastname", "000-000-0000"); Customer c2 = new Customer(3, "*****@*****.**", "firstnone", "lastnone", "555-555-5555"); // add each to list list += c1; list += c2; //save something first list.Save(); // pull it back list.Fill(); Console.WriteLine("Testing customer list indexer"); Console.WriteLine("Index 0. Expecting first customer in list to be [email protected] \n" + list[0]); Console.WriteLine("Index '*****@*****.**'. Expecting product with email of '*****@*****.**' \n" + list["*****@*****.**"]); Console.WriteLine(); }
static void TestCustomerListFill() { CustomerList cl = new CustomerList(); List <Customer> customers; customers = CustomerDB.GetCustomers(); Console.WriteLine("Testing CustomerList fill."); Console.Write("Expecting "); for (int i = 0; i < customers.Count; i++) { Console.WriteLine(customers[i]); } cl.Fill(); Console.Write("Getting "); for (int i = 0; i < cl.Count; i++) { Console.WriteLine(cl[i].GetDisplayText()); } Console.WriteLine(); }
private void frmCustomers_Load(object sender, EventArgs e) { customers.Changed += new CustomerList.ChangeHandler(HandleChange); customers.Fill(); FillCustomerListBox(); }