Exemple #1
0
        public void ClassMappingCorrectAfterConfiguration()
        {
            var mockConfigurer = new MockAutomappingConfigurer();

            SqlCeDataServicesProvider provider = new SqlCeDataServicesProvider(CurrentDirectory, DbName)
            {
                AutomappingConfigurer = mockConfigurer
            };

            NHibernate.Cfg.Configuration cfg = provider.BuildConfiguration(
                new DataServiceParameters {
                CreateDatabase = EnsureDatabase()
            });

            Assert.That(cfg.ClassMappings.Count, Is.EqualTo(mockConfigurer.ModelCount));
        }
Exemple #2
0
        public void DatabaseExistsAfterConfiguration()
        {
            DeleteDatabase();

            SqlCeDataServicesProvider provider = new SqlCeDataServicesProvider(CurrentDirectory, DbName)
            {
                AutomappingConfigurer = new MockAutomappingConfigurer()
            };

            NHibernate.Cfg.Configuration cfg = provider.BuildConfiguration(
                new DataServiceParameters {
                CreateDatabase = true
            });

            Assert.That(EnsureDatabase(), Is.True);
        }