public void Creation()
        {
            var TestObject = new SQLServerQueryProvider(Configuration, ObjectPool);

            Assert.Equal(Configuration, TestObject.Configuration);
            Assert.Equal(SqlClientFactory.Instance, TestObject.Provider);
        }
        public SessionWithMapBaseClassProperties()
        {
            InternalMappingManager = new MappingManager(new IMapping[] {
                new AllReferencesAndIDMappingWithDatabase(),
                new MapPropertiesWithBaseClassesMapping(),
                new MapProperty2Mapping(),
                new MapProperty1Mapping(),
                new MapPropertyBaseClassMapping(),
                new IMapPropertyInterfaceMapping()
            },
                                                        new IDatabase[] {
                new TestDatabaseMapping()
            },
                                                        new QueryProviderManager(new[] { new SQLServerQueryProvider(Configuration, ObjectPool) }, Logger),
                                                        Canister.Builder.Bootstrapper.Resolve <ILogger>(),
                                                        ObjectPool);
            InternalSchemaManager = new SchemaManager(InternalMappingManager, Configuration, Logger, DataModeler, Sherlock, Helper);

            var TempQueryProvider = new SQLServerQueryProvider(Configuration, ObjectPool);

            InternalQueryProviderManager = new QueryProviderManager(new[] { TempQueryProvider }, Logger);

            CacheManager = Canister.Builder.Bootstrapper.Resolve <BigBook.Caching.Manager>();
            CacheManager.Cache().Clear();
        }
        public void Batch()
        {
            var TestObject = new SQLServerQueryProvider(Configuration, ObjectPool);
            var Result     = TestObject.Batch(new TestDatabases.Databases.TestDatabase2Mapping(), DynamoFactory);

            Assert.NotNull(Result);
        }
Exemple #4
0
        public void Creation()
        {
            var TempQueryProvider = new SQLServerQueryProvider(Configuration, ObjectPool);
            var TestObject        = new QueryProviderManager(new[] { TempQueryProvider }, Logger);

            Assert.Equal(SqlClientFactory.Instance, TestObject.Providers.Keys.First());
            Assert.Equal(TempQueryProvider, TestObject.Providers.Values.First());
        }
Exemple #5
0
        public void CreateBatch()
        {
            var TempQueryProvider = new SQLServerQueryProvider(Configuration, ObjectPool);
            var TestObject        = new QueryProviderManager(new[] { TempQueryProvider }, Logger);
            var Result            = TestObject.CreateBatch(new MockDatabaseMapping(), DynamoFactory);

            Assert.NotNull(Result);
        }
        public void CreateGenerator()
        {
            var TestObject = new SQLServerQueryProvider(Configuration, ObjectPool);
            var Mappings   = new MappingSource(new IMapping[] {
                new BaseClass1Mapping(),
                new ConcreteClass1Mapping(),
                new ConcreteClass2Mapping(),
                new ConcreteClass3Mapping(),
                new IInterface1Mapping(),
                new IInterface2Mapping()
            },
                                               new MockDatabaseMapping(),
                                               new QueryProviderManager(new[] { new SQLServerQueryProvider(Configuration, ObjectPool) }, Logger),
                                               Canister.Builder.Bootstrapper.Resolve <ILogger>(),
                                               ObjectPool);
            var Result = TestObject.CreateGenerator <ConcreteClass1>(Mappings);

            Assert.Equal(typeof(ConcreteClass1), Result.AssociatedType);
        }
Exemple #7
0
        public SessionWithManyToManyPropertiesSelfReferencing()
        {
            InternalMappingManager = new MappingManager(new IMapping[] {
                new ManyToManyPropertySelfReferencingMapping()
            },
                                                        new IDatabase[] {
                new TestDatabaseMapping()
            },
                                                        new QueryProviderManager(new[] { new SQLServerQueryProvider(Configuration, ObjectPool) }, Logger),
                                                        Canister.Builder.Bootstrapper.Resolve <ILogger>(),
                                                        ObjectPool);
            InternalSchemaManager = new SchemaManager(InternalMappingManager, Configuration, Logger, DataModeler, Sherlock, Helper);

            var TempQueryProvider = new SQLServerQueryProvider(Configuration, ObjectPool);

            InternalQueryProviderManager = new QueryProviderManager(new[] { TempQueryProvider }, Logger);

            CacheManager = Canister.Builder.Bootstrapper.Resolve <BigBook.Caching.Manager>();
            CacheManager.Cache().Clear();
        }