示例#1
0
        public void Extensions_T012_GetSqlDbType()
        {
            Type      TypeToTest;
            SqlDbType TypeReturned;

            TypeToTest = typeof(System.String[]);

            // If It throw the exception is because the Type is not convertible to any SqlDbType.
            // System.MissingMethodException: 'No parameterless constructor defined for this object.'
            TypeReturned = TypeToTest.GetSqlDbType();
        }
示例#2
0
        public void Extensions_T011_GetSqlDbType()
        {
            Type      TypeToTest;
            SqlDbType TypeReturned;

            TypeToTest   = typeof(System.String);
            TypeReturned = TypeToTest.GetSqlDbType();
            Assert.IsTrue(TypeReturned.ToString() == (SqlDbType.NVarChar.ToString()));

            TypeToTest   = typeof(System.Int16);
            TypeReturned = TypeToTest.GetSqlDbType();
            Assert.IsTrue(TypeReturned.ToString() == SqlDbType.SmallInt.ToString());
        }