public void testMergeWithGoogle() { try { GoogleContactDownloader gcd = new GoogleContactDownloader(GoogleContactDownloader.TestUser, GoogleContactDownloader.TestPass); IContact c1 = new GContactSync.Contact("John Doe", "*****@*****.**"); IContactManager m1 = new MockContactManager { GetContactsImpl = () => { var l = new List <IContact>(); l.Add(c1); return(l); } }; IEnumerable <IContact> googleContacts = gcd.GetContacts(); googleContacts = googleContacts.Where(c => c.FullName != null && c.FullName.Contains("Doe")); ContactMerger.Merge(gcd, m1, googleContacts, m1.GetContacts()); } catch (System.Exception ex) { throw ex; } }
public void TestCreateAGoogleContact() { GContactSync.Contact c = new GContactSync.Contact("John Doe"); c.addMail("*****@*****.**"); GoogleContactDownloader gcd = new GoogleContactDownloader(GoogleContactDownloader.TestUser, GoogleContactDownloader.TestPass); int oldCount = gcd.GetContacts().Count(); IContact gc = gcd.NewContact(c); gc.Update(); Assert.AreEqual(gcd.GetContacts().Count(), oldCount + 1); }