public void It_Should_Deserialise_To_This()
        {
            const string xml = When_Serialising_A_RelationshipMapping_With_All_Fields_Set.FullMappingXml;

            RelationshipReferenceMapping mapping = new MappingSetDeserialisationScheme().DeserialiseRelationshipMapping(xml.GetXmlDocRoot(), database, entitySet);

            TestMapping(mapping, relationship, reference);
        }
        public void It_Should_Deserialise_To_This()
        {
            var xml = When_Serialising_A_Mapping_With_All_Fields_Set.FullMappingXml;

            Mapping mapping = new MappingSetDeserialisationScheme().DeserialiseMapping(xml.GetXmlDocRoot(), database, entitySet);

            TestMapping(mapping, table, entity1);
        }
示例#3
0
        public void It_Should_Deserialise_To_This()
        {
            var xml = "<MappingSet />";

            Database  database  = new Database("DB1");
            EntitySet entitySet = new EntitySetImpl();

            MappingSet set = new MappingSetDeserialisationScheme().DeserialiseMappingSet(xml.GetXmlDocRoot(), database, entitySet);

            Assert.That(set.EntitySet, Is.SameAs(entitySet));
            Assert.That(set.Database, Is.SameAs(database));
        }
        public void It_Should_Deserialise_To_This()
        {
            var xml = When_Serialising_A_Mapping_With_All_Fields_Set.FullMappingXml;

            ComponentMapping mapping = new MappingSetDeserialisationScheme().DeserialiseComponentMapping(xml.GetXmlDocRoot(), database, entitySet);

            Assert.That(mapping.FromTable, Is.SameAs(table));
            Assert.That(mapping.ToComponent, Is.SameAs(component1));
            Assert.That(mapping.FromColumns.Count, Is.EqualTo(1));
            Assert.That(mapping.ToProperties.Count, Is.EqualTo(1));
            Assert.That(mapping.FromColumns[0], Is.SameAs(((ITable)table).Columns[0]));
            Assert.That(mapping.ToProperties[0], Is.EqualTo(component1.Properties.ElementAt(0)));
        }
示例#5
0
        public void It_Should_Deserialise_To_This()
        {
            var xml = Specs_For_Serialisation_Of_MappingSets.When_Serialising_A_MappingSet_With_Mappings.FullMappingSetXml;

            var testData = new When_Deserialising_A_Mapping_With_All_Fields_Set();

            testData.Setup();

            MappingSet set = new MappingSetDeserialisationScheme().DeserialiseMappingSet(xml.GetXmlDocRoot(), testData.database, testData.entitySet);

            Assert.That(set.EntitySet, Is.SameAs(testData.entitySet));
            Assert.That(set.Database, Is.SameAs(testData.database));
            Assert.That(set.Mappings.Count, Is.EqualTo(1));
            Assert.That(set.ReferenceMappings.Count, Is.EqualTo(1));
            When_Deserialising_A_Mapping_With_All_Fields_Set.TestMapping(set.Mappings[0], testData.table, testData.entity1);
            When_Deserialising_A_ReferenceMapping_With_All_Fields_Set.TestMapping(set.ReferenceMappings[0], testData.table, testData.entity1.References[0]);
        }