Пример #1
0
        public void TestReplaceContact()
        {
            Application             app          = new Application();
            OutlookContactsWithSifC agent        = new OutlookContactsWithSifC(app);
            OutlookContacts         outlookAgent = new OutlookContacts(app);

            AddContactToOutlook();
            string existingEntryId = outlookAgent.GetEntryIdByDisplayName("Ing John Patrick Doe Sn");

            XElement x       = XElement.Load(MockPath + "sifc.xml");
            string   entryId = agent.ReplaceItem(x.ToString(), existingEntryId);

            Assert.IsTrue(entryId == existingEntryId);
        }
Пример #2
0
        public void AddContactToOutlook()
        {
            XElement                x            = XElement.Load(MockPath + "sifc.xml");
            Application             app          = new Application();
            OutlookContactsWithSifC agent        = new OutlookContactsWithSifC(app);
            OutlookContacts         outlookAgent = new OutlookContacts(app);

            string entryId = outlookAgent.GetEntryIdByDisplayName("Ing John Patrick Doe Sn");//Delete it if exists

            if (entryId != null)
            {
                bool deletionOK = outlookAgent.DeleteItem(entryId);
                Assert.IsTrue(deletionOK);
            }
            agent.AddItem(x.ToString());//Add to outlook
            entryId = outlookAgent.GetEntryIdByDisplayName("Ing John Patrick Doe Sn");
            Assert.IsTrue(entryId != null);
        }