コード例 #1
0
        public void Verify(IEnumerable <XElement> expectedXElements, IEnumerable <XElement> actualXElements)
        {
            Assert.AreEqual(expectedXElements.Count(), actualXElements.Count(), "Unexpected number of Csdl files!");

            var comparer = new CsdlXElementComparer();

            // extract EntityContainers into one place
            XElement expectedContainers = CsdlElementExtractor.ExtractElementByName(expectedXElements, "EntityContainer");
            XElement actualContainers   = CsdlElementExtractor.ExtractElementByName(actualXElements, "EntityContainer");

            // compare just the EntityContainers
            Console.WriteLine("Expected: " + expectedContainers.ToString());
            Console.WriteLine("Actual: " + actualContainers.ToString());
            comparer.Compare(expectedContainers, actualContainers);

            // compare non-EntityContainers
            foreach (XElement expectedXElement in expectedXElements)
            {
                string   schemaNamespace = expectedXElement.Attribute("Namespace").Value;
                XElement actualXElement  = actualXElements.FirstOrDefault(e => schemaNamespace == e.Attribute("Namespace").Value);

                Assert.IsNotNull(actualXElement, "Cannot find schema for '{0}' in result Csdls!", schemaNamespace);

                Console.WriteLine("Expected: " + expectedXElement.ToString());
                Console.WriteLine("Actual: " + actualXElement.ToString());
                comparer.Compare(expectedXElement, actualXElement);
            }
        }
コード例 #2
0
        public void Verify(IEnumerable<XElement> expectedXElements, IEnumerable<XElement> actualXElements)
        {
            Assert.AreEqual(expectedXElements.Count(), actualXElements.Count(), "Unexpected number of Csdl files!");

            var comparer = new CsdlXElementComparer();

            // extract EntityContainers into one place
            XElement expectedContainers = CsdlElementExtractor.ExtractElementByName(expectedXElements, "EntityContainer");
            XElement actualContainers = CsdlElementExtractor.ExtractElementByName(actualXElements, "EntityContainer");

            // compare just the EntityContainers
            Console.WriteLine("Expected: " + expectedContainers.ToString());
            Console.WriteLine("Actual: " + actualContainers.ToString());
            comparer.Compare(expectedContainers, actualContainers);

            // compare non-EntityContainers
            foreach (XElement expectedXElement in expectedXElements)
            {
                string schemaNamespace = expectedXElement.Attribute("Namespace").Value;
                XElement actualXElement = actualXElements.FirstOrDefault(e => schemaNamespace == e.Attribute("Namespace").Value);

                Assert.IsNotNull(actualXElement, "Cannot find schema for '{0}' in result Csdls!", schemaNamespace);

                Console.WriteLine("Expected: " + expectedXElement.ToString());
                Console.WriteLine("Actual: " + actualXElement.ToString());
                comparer.Compare(expectedXElement, actualXElement);
            }
        }
コード例 #3
0
 public ConstructiveApiCsdlXElementComparer()
 {
     this.csdlXElementComparer = new CsdlXElementComparer();
 }
コード例 #4
0
 public ConstructiveApiCsdlXElementComparer()
 {
     this.csdlXElementComparer = new CsdlXElementComparer();
 }