コード例 #1
0
        public void Cloning_an_foreign_key_mapping_configuration_clones_its_table_and_column_information()
        {
            var configuration = new ForeignKeyAssociationMappingConfiguration();

            configuration.MapKey("C1");
            configuration.ToTable("T", "S");

            var clone = (ForeignKeyAssociationMappingConfiguration)configuration.Clone();

            Assert.Equal(configuration, clone);

            configuration.MapKey("C2");

            Assert.NotEqual(configuration, clone);
        }
コード例 #2
0
        public void Cloning_an_foreign_key_mapping_configuration_clones_its_annotation_information()
        {
            var configuration = new ForeignKeyAssociationMappingConfiguration();

            configuration.MapKey("C1", "C2");
            configuration.HasColumnAnnotation("C1", "A1", "V1");
            configuration.HasColumnAnnotation("C2", "A2", "V2");

            var clone = (ForeignKeyAssociationMappingConfiguration)configuration.Clone();

            Assert.Equal(configuration, clone);

            configuration.HasColumnAnnotation("C2", "A2", "V3");

            Assert.NotEqual(configuration, clone);
        }