public void PersonSearchPhoneById() { string name = "maichao"; string company = "ynu"; string position = "student"; Person person = new Person { Name = name, Company = company, Position = position }; Pair <string, string> num1 = new Pair <string, string>("187", "cellphone"); Pair <Guid, Pair <string, string> > phone1 = new Pair <Guid, Pair <string, string> >(Guid.NewGuid(), num1); person.AddPhone(phone1); Pair <string, string> num2 = new Pair <string, string>("187", "cellphone"); Pair <Guid, Pair <string, string> > phone2 = new Pair <Guid, Pair <string, string> >(Guid.NewGuid(), num2); person.AddPhone(phone2); var phone = person.SearchPhoneById(new Guid(phone2.Key.ToString())); Assert.IsNotNull(phone); Assert.AreEqual(phone2.Key, phone.Key); }
public void PersonAddPhone() { string name = "maichao"; string company = "ynu"; string position = "student"; Person person = new Person { Name = name, Company = company, Position = position }; Pair <string, string> num1 = new Pair <string, string>("187", "cellphone"); Pair <Guid, Pair <string, string> > phone1 = new Pair <Guid, Pair <string, string> >(Guid.NewGuid(), num1); person.AddPhone(phone1); Pair <string, string> num2 = new Pair <string, string>("187", "cellphone"); Pair <Guid, Pair <string, string> > phone2 = new Pair <Guid, Pair <string, string> >(Guid.NewGuid(), num2); person.AddPhone(phone2); Assert.AreEqual(2, person.Phones.Count); }
public void PersonGetPhones() { string name = "maichao"; string company = "ynu"; string position = "student"; Person person = new Person { Name = name, Company = company, Position = position }; Pair <string, string> num1 = new Pair <string, string>("187", "cellphone"); Pair <Guid, Pair <string, string> > phone1 = new Pair <Guid, Pair <string, string> >(Guid.NewGuid(), num1); person.AddPhone(phone1); Pair <string, string> num2 = new Pair <string, string>("187", "cellphone"); Pair <Guid, Pair <string, string> > phone2 = new Pair <Guid, Pair <string, string> >(Guid.NewGuid(), num2); person.AddPhone(phone2); var phones = person.Phones; Assert.IsNotNull(phones); }