object ChangeValueType(object value, int ordinal) {
            if(value == null)
                return null;

            BigQueryDbType bigQueryType = BigQueryTypeConverter.ToBigQueryDbType(schema.Fields[ordinal].Type);
            if(bigQueryType == BigQueryDbType.Timestamp) {
                return UnixTimeStampToDateTime(value);
            }

            return Convert.ChangeType(value, BigQueryTypeConverter.ToType(schema.Fields[ordinal].Type), CultureInfo.InvariantCulture);
        }
 public void TimesTest(string bigQueryTypeName, Type systemType, BigQueryDbType bigQueryDbType, DbType dbType)
 {
     Assert.Equal(systemType, BigQueryTypeConverter.ToType(bigQueryTypeName));
     Assert.Equal(bigQueryDbType, BigQueryTypeConverter.ToBigQueryDbType(bigQueryTypeName));
     Assert.Equal(dbType, BigQueryTypeConverter.ToDbType(bigQueryDbType));
 }
 public void TypeAndBigQueryDbTypeTest(Type type1, BigQueryDbType bigQueryType, Type type2)
 {
     Assert.Equal(bigQueryType, BigQueryTypeConverter.ToBigQueryDbType(type1));
     Assert.Equal(type2, BigQueryTypeConverter.ToType(bigQueryType));
 }
 public void StringConvertTest(string stringType, Type systemType, BigQueryDbType bigQueryType)
 {
     Assert.Equal(systemType, BigQueryTypeConverter.ToType(stringType));
     Assert.Equal(bigQueryType, BigQueryTypeConverter.ToBigQueryDbType(stringType));
 }
 public void DbTypeAndBigQueryDbTypeTest(DbType dbType1, BigQueryDbType bigQueryType, DbType dbType2)
 {
     Assert.Equal(bigQueryType, BigQueryTypeConverter.ToBigQueryDbType(dbType1));
     Assert.Equal(dbType2, BigQueryTypeConverter.ToDbType(bigQueryType));
 }