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(); }
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()); }