コード例 #1
0
        public void Cloning_a_complex_type_configuration_clones_its_scalar_properties()
        {
            var configuration = new ComplexTypeConfiguration(typeof(object));

            var clone = configuration.Clone();

            Assert.Same(typeof(object), clone.ClrType);
        }
コード例 #2
0
        public void Cloning_a_complex_type_configuration_clones_its_ignored_properties()
        {
            var configuration = new ComplexTypeConfiguration(typeof(object));

            var mockProperty1 = new MockPropertyInfo(typeof(int), "P1");

            configuration.Ignore(mockProperty1);

            var clone = configuration.Clone();

            Assert.True(clone.IgnoredProperties.Contains(mockProperty1));

            var mockProperty2 = new MockPropertyInfo(typeof(int), "P2");

            configuration.Ignore(mockProperty2);

            Assert.False(clone.IgnoredProperties.Contains(mockProperty2));
        }
コード例 #3
0
        public void Cloning_a_complex_type_configuration_clones_its_primitive_property_information()
        {
            var configuration = new ComplexTypeConfiguration(typeof(object));

            var mockProperty1 = new MockPropertyInfo(typeof(int), "P1");
            var propConfig1   = configuration.Property(new PropertyPath(mockProperty1));

            var clone = configuration.Clone();

            Assert.True(clone.ConfiguredProperties.Contains(mockProperty1));
            Assert.NotSame(propConfig1, clone.Property(new PropertyPath(mockProperty1)));

            var mockProperty2 = new MockPropertyInfo(typeof(int), "P2");

            configuration.Property(new PropertyPath(mockProperty2));

            Assert.False(clone.ConfiguredProperties.Contains(mockProperty2));
        }