Esempio n. 1
0
        public void IsDeclaringTypePrincipal_sets_IsNavigationPropertyDeclaringTypePrincipal()
        {
            var configuration =
                new NavigationPropertyConfiguration(
                    typeof(LightweighEntity).GetDeclaredProperty("ValidNavigationProperty"));
            var lightweightConfiguration = new ConventionNavigationPropertyConfiguration(configuration, new ModelConfiguration());

            lightweightConfiguration.IsDeclaringTypePrincipal(false);
            Assert.Equal(false, configuration.IsNavigationPropertyDeclaringTypePrincipal);

            configuration.IsNavigationPropertyDeclaringTypePrincipal = true;
            lightweightConfiguration.IsDeclaringTypePrincipal(false);
            Assert.Equal(true, configuration.IsNavigationPropertyDeclaringTypePrincipal);
        }
Esempio n. 2
0
        public void Methods_dont_throw_if_configuration_is_null()
        {
            var config = new ConventionNavigationPropertyConfiguration(null, null);

            Assert.Null(config.ClrPropertyInfo);
            config.HasConstraint <IndependentConstraintConfiguration>();
            config.HasDeleteAction(OperationAction.Cascade);
            config.HasInverseEndMultiplicity(RelationshipMultiplicity.ZeroOrOne);
            config.HasInverseNavigationProperty(p => new MockPropertyInfo());
            config.IsDeclaringTypePrincipal(true);
            config.HasRelationshipMultiplicity(RelationshipMultiplicity.ZeroOrOne);
        }