예제 #1
0
        public void OneItemInMultiRemains()
        {
            var multiSomethingData = new XElement("MultiSomething",
                                                  new XElement("AStr", new XAttribute("ws", "en")));

            DataSortingService.SortMultiSomethingProperty(multiSomethingData);
            Assert.AreEqual("MultiSomething", multiSomethingData.Name.LocalName);
            Assert.AreEqual(1, multiSomethingData.Elements().Count());
            Assert.AreEqual("en", multiSomethingData.Element("AStr").Attribute("ws").Value);
        }
예제 #2
0
        public void MultiSomethingPropertyIsSorted()
        {
            var multiSomethingData = new XElement("MultiSomething",
                                                  new XElement("AStr", new XAttribute("ws", "es")),
                                                  new XElement("AStr", new XAttribute("ws", "en")));

            DataSortingService.SortMultiSomethingProperty(multiSomethingData);
            Assert.AreEqual("MultiSomething", multiSomethingData.Name.LocalName);
            Assert.AreEqual(2, multiSomethingData.Elements().Count());
            Assert.AreEqual("en", multiSomethingData.Elements().ElementAt(0).Attribute("ws").Value);
            Assert.AreEqual("es", multiSomethingData.Elements().ElementAt(1).Attribute("ws").Value);
        }