public void NewMembersHandlesEmptyMemberList() { XDocument o = XDocument.Load("TestData/oldxml/AVAssetImageGeneratorCompletionHandler.xml"); XDocument n = XDocument.Load("TestData/currentxml/AVAssetImageGeneratorCompletionHandler.xml"); Assert.IsEmpty(EcmaXmlHelper.NewMembers(n, o)); }
public void NewElementsYieldsAddedElements() { XDocument xmlNew = XDocument.Load("TestData/currentxml/t1.xml"); XDocument xmlOld = XDocument.Load("TestData/oldxml/t1.xml"); IEnumerable <XElement> newMembers = EcmaXmlHelper.NewMembers(xmlNew, xmlOld); XElement e1 = xmlNew.Element("Type").Element("Members").Elements() .FirstOrDefault((XElement arg) => arg.Attribute("MemberName").Value == "WeakDelegate"); XElement e2 = xmlNew.Element("Type").Element("Members").Elements() .FirstOrDefault((XElement arg) => arg.Attribute("MemberName").Value == "WeakDataSource"); Assert.AreEqual(2, newMembers.Count()); Assert.True(newMembers.Contains(e1)); Assert.True(newMembers.Contains(e2)); }