public void MapToStoredProcedures_when_no_configuration_should_create_empty_configuration()
        {
            var navigationPropertyConfiguration = new NavigationPropertyConfiguration(new MockPropertyInfo(typeof(AType1), "N"));
            var manyToManyNavigationPropertyConfiguration
                = new ManyToManyNavigationPropertyConfiguration<string, string>(navigationPropertyConfiguration);

            manyToManyNavigationPropertyConfiguration.MapToStoredProcedures();

            Assert.NotNull(navigationPropertyConfiguration.ModificationStoredProceduresConfiguration);
        }
Esempio n. 2
0
        public void MapToStoredProcedures_when_no_configuration_should_create_empty_configuration()
        {
            var navigationPropertyConfiguration = new NavigationPropertyConfiguration(new MockPropertyInfo(new MockType(), "N"));
            var manyToManyNavigationPropertyConfiguration
                = new ManyToManyNavigationPropertyConfiguration <string, string>(navigationPropertyConfiguration);

            manyToManyNavigationPropertyConfiguration.MapToStoredProcedures();

            Assert.NotNull(navigationPropertyConfiguration.ModificationFunctionsConfiguration);
        }
 private static ManyToManyNavigationPropertyConfiguration <TEntityType, TTargetEntityType> MapManyToMany
 <TEntityType, TTargetEntityType>(
     this ManyToManyNavigationPropertyConfiguration <TEntityType, TTargetEntityType> cfg,
     string leftKey,
     string rightKey,
     string table)
     where TEntityType : class
     where TTargetEntityType : class
 {
     return(cfg.Map(m => m.MapLeftKey(leftKey).MapRightKey(rightKey).ToTable(table)));
 }
        public void Map_should_set_configuration()
        {
            var navigationPropertyConfiguration = new NavigationPropertyConfiguration(new MockPropertyInfo());
            var manyToManyNavigationPropertyConfiguration
                = new ManyToManyNavigationPropertyConfiguration(navigationPropertyConfiguration);

            manyToManyNavigationPropertyConfiguration.Map(c => c.ToTable("Foo"));

            Assert.NotNull(navigationPropertyConfiguration.AssociationMappingConfiguration);
            Assert.IsType<ManyToManyAssociationMappingConfiguration>(
                navigationPropertyConfiguration.AssociationMappingConfiguration);
        }
Esempio n. 5
0
        public void Map_should_set_configuration()
        {
            var navigationPropertyConfiguration = new NavigationPropertyConfiguration(new MockPropertyInfo(new MockType(), "N"));
            var manyToManyNavigationPropertyConfiguration
                = new ManyToManyNavigationPropertyConfiguration <string, string>(navigationPropertyConfiguration);

            manyToManyNavigationPropertyConfiguration.Map(c => c.ToTable("Foo"));

            Assert.NotNull(navigationPropertyConfiguration.AssociationMappingConfiguration);
            Assert.IsType <ManyToManyAssociationMappingConfiguration>(
                navigationPropertyConfiguration.AssociationMappingConfiguration);
        }
        public void MapToStoredProcedures_when_configuration_should_assign_configuration_to_nav_prop_configuration()
        {
            var navigationPropertyConfiguration = new NavigationPropertyConfiguration(new MockPropertyInfo(typeof(AType1), "N"));
            var manyToManyNavigationPropertyConfiguration
                = new ManyToManyNavigationPropertyConfiguration<string, string>(navigationPropertyConfiguration);

            var called = false;

            manyToManyNavigationPropertyConfiguration.MapToStoredProcedures(m => { called = true; });

            Assert.True(called);
            Assert.NotNull(navigationPropertyConfiguration.ModificationStoredProceduresConfiguration);
        }
Esempio n. 7
0
        public void MapToStoredProcedures_when_configuration_should_assign_configuration_to_nav_prop_configuration()
        {
            var navigationPropertyConfiguration = new NavigationPropertyConfiguration(new MockPropertyInfo(new MockType(), "N"));
            var manyToManyNavigationPropertyConfiguration
                = new ManyToManyNavigationPropertyConfiguration <string, string>(navigationPropertyConfiguration);

            var called = false;

            manyToManyNavigationPropertyConfiguration.MapToStoredProcedures(m => { called = true; });

            Assert.True(called);
            Assert.NotNull(navigationPropertyConfiguration.ModificationFunctionsConfiguration);
        }
 public ManyToManyNavigationPropertyConfigurationWrapper(ManyToManyNavigationPropertyConfiguration <TEntity, TTargetEntity> manyToManyNavigationPropertyConfiguration)
 {
     this.manyToManyNavigationPropertyConfiguration = manyToManyNavigationPropertyConfiguration;
 }