· 11 years ago · May 15, 2015, 11:50 PM
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using System.Threading.Tasks;
6using CustomerMaintenanceClasses;
7
8namespace CustomerTests
9{
10 class Program
11 {
12 static void CustomerTest()
13 {
14 Customer c1 = new Customer();
15 Customer c2 = new Customer("Mari", "Good", "goodm@lanecc.edu");
16
17 Console.WriteLine("Testing both constructors");
18 Console.WriteLine("Default constructor. Expecting default values. " + c1);
19 Console.WriteLine("Overloaded constructor. Expecting Mari Good (goodm@lanecc.edu). " + c2);
20 Console.WriteLine();
21
22 Console.WriteLine("Testing setters");
23 c1.FirstName = "Mickey";
24 c1.LastName = "Mouse";
25 c1.Email = "mmouse@disney.com";
26 Console.WriteLine("Expecting Mickey Mouse (mmouse@disney.com) " + c1.ToString());
27 Console.WriteLine();
28
29 Console.WriteLine("Testing getters");
30 Console.WriteLine("FirstName. Expecting Mickey. " + c1.FirstName);
31 Console.WriteLine("LastName. Expecting Mouse. " + c1.LastName);
32 Console.WriteLine("Email. Expecting mmouse@disney.com. " + c1.Email);
33
34 /*Customer c30 = new Customer();
35 c30.Email = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz@asdf.com";
36 Console.WriteLine("Email: {0}", c30.Email);*/
37 Customer zach = new Customer();
38 Customer zach2 = new Customer();
39
40 zach.FirstName = "Za";
41 zach2.FirstName = "ch";
42
43 zach.LastName = "Re";
44 zach2.LastName = "ese";
45
46 zach.Email = "elroyjr";
47 zach2.Email = "@gmail.com";
48
49 Customer c3 = new Customer();
50 c3.FirstName = zach.FirstName + zach2.FirstName;
51 c3.LastName = zach.LastName + zach2.LastName;
52 c3.Email = zach.Email + zach2.Email;
53 Console.WriteLine("\n" + "Customer 3 " + "\n" + "Firstname: {0}" + "\n" + "Lastname: {1}" + "\n" + "Email: {2}", c3.FirstName, c3.LastName, c3.Email);
54
55 list += c3;
56
57
58 }
59
60 public static void CustomerListTest()
61 {
62 CustomerList list = new CustomerList();
63 }
64 static void Main(string[] args)
65 {
66 CustomerTest();
67 CustomerListTest();
68 Console.ReadLine();
69 }
70 }
71}