示例#1
0
        public void Convert()
        {
            var xmlPath   = @"E:\Ahoo\SmartCode\src\SmartCode\DbTypeConverter\DbTypeMap.xml";
            var patamters = new Dictionary <string, object> {
                { "XmlPath", xmlPath }
            };
            IDbTypeConverter convert = new DefaultDbTypeConverter(NullLogger <DefaultDbTypeConverter> .Instance);

            convert.Initialize(patamters);
            var langType = convert.LanguageType(DbProvider.SqlServer, "CSharp", "int");

            Assert.Equal("Int16", langType);
        }
示例#2
0
        public void Convert()
        {
            var logger    = SmartSql.Logging.NoneLoggerFactory.Instance.CreateLogger <DefaultDbTypeConverter>();
            var xmlPath   = @"E:\Ahoo\SmartCode\src\SmartCode\DbTypeConverter\DbTypeMap.xml";
            var patamters = new Dictionary <string, string> {
                { "XmlPath", xmlPath }
            };
            IDbTypeConverter convert = new DefaultDbTypeConverter(logger);

            convert.Initialize(patamters);
            var langType = convert.LanguageType(DbProvider.SqlServer, "CSharp", "int");

            Assert.Equal("Int16", langType);
        }