static void AssertMappingsEqual(SchemaMapping expected, SchemaMapping actual)
        {
            Assert.AreEqual(expected.Schema, actual.Schema);
            Assert.AreEqual(expected.SqlName, actual.SqlName);
            Assert.AreEqual(expected.SqlSchemaName, actual.SqlSchemaName);

            Assert.AreEqual(expected.Columns.Count, actual.Columns.Count);

            for (int i = 0; i < expected.Columns.Count; i++) {
                ColumnMapping e = expected.Columns[i], a = actual.Columns[i];
                Assert.AreEqual(e.Column, a.Column);
                Assert.AreEqual(e.SqlName, a.SqlName);
            }

            Assert.AreEqual(expected.ToXml().ToString(), actual.ToXml().ToString());
        }
 static void TestMapping(SchemaMapping mapping)
 {
     AssertMappingsEqual(mapping, SchemaMapping.FromXml(mapping.ToXml(), mapping.Schema));
 }
        public void XmlPropertiesTest()
        {
            var schema = new TableSchema("XmlPropertiesTest");

            var mapping = new SchemaMapping(schema);
            var newMapping = SchemaMapping.FromXml(mapping.ToXml(), schema);

            TestMapping(mapping);

            mapping.SqlSchemaName = "ABC";
            TestMapping(mapping);

            mapping.SqlName = "DEF";
            TestMapping(mapping);
        }