public void TestAddNotes() { XElement x = XElement.Load(MockPath + "SifN.xml"); Application app = new Application(); OutlookNotesWithSifN agent = new OutlookNotesWithSifN(app); OutlookNotes outlookAgent = new OutlookNotes(app); string entryId = outlookAgent.GetEntryIdByDisplayName(subject); if (entryId != null) { bool deletionOK = outlookAgent.DeleteItem(entryId); Assert.IsTrue(deletionOK); } agent.AddItem(x.ToString()); entryId = outlookAgent.GetEntryIdByDisplayName(subject); Assert.IsTrue(entryId != null); }
public void TestReplaceNotes() { Application app = new Application(); OutlookNotesWithSifN agent = new OutlookNotesWithSifN(app); OutlookNotes outlookAgent = new OutlookNotes(app); TestAddNotes(); string existingEntryId = outlookAgent.GetEntryIdByDisplayName(subject); XElement x = XElement.Load(MockPath + "SifN.xml"); string entryId = agent.ReplaceItem(x.ToString(), existingEntryId); Assert.IsTrue(entryId == existingEntryId); NoteItem note = outlookAgent.GetItemByEntryId(entryId); Assert.IsTrue(String.Compare(note.Body, x.Element("Body").Value, System.Globalization.CultureInfo.CurrentCulture, System.Globalization.CompareOptions.IgnoreSymbols) == 0); Assert.AreEqual(note.Subject, x.Element("Subject").Value); Assert.AreEqual(note.Categories, x.Element("Categories").Value); Assert.AreEqual(((int)note.Color).ToString(), x.Element("Color").Value); }