Ejemplo n.º 1
0
        public void TestDataEntityExtensionGetTableName()
        {
            // Prepare
            var dbSetting = new CustomDbSetting();

            // Act
            var schema = DataEntityExtension.GetTableName("TableName", dbSetting);

            // Assert
            Assert.AreEqual("TableName", schema);
        }
Ejemplo n.º 2
0
        public void TestDataEntityExtensionGetSchemaFromQuotedAndIsWhitespaced()
        {
            // Prepare
            var dbSetting = new CustomDbSetting();

            // Act
            var schema = DataEntityExtension.GetSchema("[Schema Name].[TableName]", dbSetting);

            // Assert
            Assert.AreEqual("[Schema Name]", schema);
        }
Ejemplo n.º 3
0
        public void TestDbSettingMapperMappingViaGeneric()
        {
            // Setup
            var dbSetting = new CustomDbSetting();

            DbSettingMapper.Add <CustomDbConnection>(dbSetting, true);

            // Act
            var actual = DbSettingMapper.Get <CustomDbConnection>();

            // Assert
            Assert.AreSame(dbSetting, actual);
        }
Ejemplo n.º 4
0
        public void TestDbSettingMapperMappingCanBeRemovedViaGeneric()
        {
            // Setup
            var dbSetting = new CustomDbSetting();

            DbSettingMapper.Add <CustomDbConnection>(dbSetting, true);

            // Act
            DbSettingMapper.Remove <CustomDbConnection>();

            // Assert
            var actual = DbSettingMapper.Get <CustomDbConnection>();

            Assert.IsNull(actual);
        }