Пример #1
0
        public void OneItemInCollectionRemains()
        {
            var collData = new XElement("CollectionProperty",
                                        new XElement("objsur", new XAttribute("guid", "c1ecf889-e382-11de-8a39-0800200c9a66")));

            DataSortingService.SortCollectionProperties(collData);
            Assert.AreEqual("CollectionProperty", collData.Name.LocalName);
            Assert.AreEqual(1, collData.Elements().Count());
            Assert.AreEqual("c1ecf889-e382-11de-8a39-0800200c9a66", collData.Element("objsur").Attribute("guid").Value);
        }
Пример #2
0
        public void CollectionPropertyIsSorted()
        {
            var collData = new XElement("CollectionProperty",
                                        new XElement("objsur", new XAttribute("guid", "c1ecf88b-e382-11de-8a39-0800200c9a66")),
                                        new XElement("objsur", new XAttribute("guid", "c1ecf88a-e382-11de-8a39-0800200c9a66")));

            DataSortingService.SortCollectionProperties(collData);
            Assert.AreEqual("CollectionProperty", collData.Name.LocalName);
            Assert.AreEqual(2, collData.Elements().Count());
            Assert.AreEqual("c1ecf88a-e382-11de-8a39-0800200c9a66", collData.Elements().ElementAt(0).Attribute("guid").Value);
            Assert.AreEqual("c1ecf88b-e382-11de-8a39-0800200c9a66", collData.Elements().ElementAt(1).Attribute("guid").Value);
        }