Permalink
Browse files

moved around some methods because they were on the wrong object

  • Loading branch information...
1 parent 78e774c commit f3bc872f1377947f5012683f5104dbc5265f5c52 @nberardi nberardi committed May 16, 2012
View
12 src/CassandraColumnFamilySchema.cs
@@ -23,26 +23,26 @@ public CassandraColumnFamilySchema(CfDef def)
var familyType = ColumnType.Standard;
Enum.TryParse<ColumnType>(def.Column_type, out familyType);
- var keyType = CassandraObject.ParseType(def.Key_validation_class);
- var defaultColumnValueType = CassandraObject.ParseType(def.Default_validation_class);
+ var keyType = CassandraType.GetCassandraType(def.Key_validation_class);
+ var defaultColumnValueType = CassandraType.GetCassandraType(def.Default_validation_class);
CassandraType columnNameType, superColumnNameType;
if (familyType == ColumnType.Super)
{
- superColumnNameType = CassandraObject.ParseType(def.Comparator_type);
- columnNameType = CassandraObject.ParseType(def.Subcomparator_type);
+ superColumnNameType = CassandraType.GetCassandraType(def.Comparator_type);
+ columnNameType = CassandraType.GetCassandraType(def.Subcomparator_type);
}
else
{
superColumnNameType = null;
- columnNameType = CassandraObject.ParseType(def.Comparator_type);
+ columnNameType = CassandraType.GetCassandraType(def.Comparator_type);
}
FamilyType = familyType;
FamilyName = def.Name;
FamilyDescription = def.Comment;
- KeyName = CassandraObject.GetTypeFromDatabaseValue(def.Key_alias, CassandraType.BytesType);
+ KeyName = CassandraObject.GetCassandraObjectFromDatabaseByteArray(def.Key_alias, CassandraType.BytesType);
KeyType = keyType;
SuperColumnNameType = superColumnNameType;
ColumnNameType = columnNameType;
View
6 src/CassandraColumnSchema.cs
@@ -15,8 +15,8 @@ public CassandraColumnSchema()
public CassandraColumnSchema(ColumnDef def, CassandraType columnNameType)
{
NameType = columnNameType;
- Name = CassandraObject.GetTypeFromDatabaseValue(def.Name, columnNameType);
- ValueType = CassandraObject.ParseType(def.Validation_class);
+ Name = CassandraObject.GetCassandraObjectFromDatabaseByteArray(def.Name, columnNameType);
+ ValueType = CassandraType.GetCassandraType(def.Validation_class);
}
private CassandraObject _name;
@@ -25,7 +25,7 @@ public CassandraObject Name
get { return _name; }
set
{
- _name = (CassandraObject)value.GetValue(NameType);
+ _name = value.GetValue(NameType);
}
}
View
4 src/FluentColumnFamily.cs
@@ -231,15 +231,15 @@ public override bool TrySetColumn(object name, object value)
mutationType = MutationType.Added;
col = new FluentColumn(schema);
- col.ColumnName = CassandraObject.GetTypeFromObject(name, schema.NameType);
+ col.ColumnName = CassandraObject.GetCassandraObjectFromObject(name, schema.NameType);
_columns.SupressChangeNotification = true;
_columns.Add(col);
_columns.SupressChangeNotification = false;
}
// set the column value
- col.ColumnValue = CassandraObject.GetTypeFromObject(value, schema.ValueType);
+ col.ColumnValue = CassandraObject.GetCassandraObjectFromObject(value, schema.ValueType);
// notify the tracker that the column has changed
OnColumnMutated(mutationType, col);
View
4 src/FluentSuperColumn.cs
@@ -230,15 +230,15 @@ public override bool TrySetColumn(object name, object value)
mutationType = MutationType.Added;
col = new FluentColumn(schema);
- col.ColumnName = CassandraObject.GetTypeFromObject(name, schema.NameType);
+ col.ColumnName = CassandraObject.GetCassandraObjectFromObject(name, schema.NameType);
_columns.SupressChangeNotification = true;
_columns.Add(col);
_columns.SupressChangeNotification = false;
}
// set the column value
- col.ColumnValue = CassandraObject.GetTypeFromObject(value);
+ col.ColumnValue = CassandraObject.GetCassandraObjectFromObject(value);
// notify the tracker that the column has changed
OnColumnMutated(mutationType, col);
View
6 src/FluentSuperColumnFamily.cs
@@ -179,7 +179,7 @@ private CassandraColumnSchema GetColumnSchema(object name)
};
if (name != null)
- colSchema.Name = CassandraObject.GetTypeFromObject(name, schema.SuperColumnNameType);
+ colSchema.Name = CassandraObject.GetCassandraObjectFromObject(name, schema.SuperColumnNameType);
return colSchema;
}
@@ -193,7 +193,7 @@ private CassandraColumnSchema GetColumnSchema(object name)
public override bool TryGetColumn(object name, out object result)
{
var col = GetColumnValue(name);
- result = (col == null) ? CreateSuperColumn(CassandraObject.GetTypeFromObject(name)) : col;
+ result = (col == null) ? CreateSuperColumn(CassandraObject.GetCassandraObjectFromObject(name)) : col;
return true;
}
@@ -214,7 +214,7 @@ public override bool TrySetColumn(object name, object value)
var mutationType = col == null ? MutationType.Added : MutationType.Changed;
col = (FluentSuperColumn)value;
- col.ColumnName = CassandraObject.GetTypeFromObject(name, schema.SuperColumnNameType);
+ col.ColumnName = CassandraObject.GetCassandraObjectFromObject(name, schema.SuperColumnNameType);
int index = Columns.IndexOf(col);
View
2 src/Operations/CassandraIndexClauseBuilder.cs
@@ -118,7 +118,7 @@ private static Cassandra.IndexExpression VisitRelationalExpression(BinaryExpress
Cassandra.IndexExpression indexExpression;
var columnName = GetColumnName(exp.Left);
- var value = CassandraObject.GetTypeFromObject(Expression.Lambda(exp.Right).Compile().DynamicInvoke(), CassandraType.BytesType);
+ var value = CassandraObject.GetCassandraObjectFromObject(Expression.Lambda(exp.Right).Compile().DynamicInvoke(), CassandraType.BytesType);
indexExpression = new Cassandra.IndexExpression {
Column_name = columnName.ToBigEndian(),
View
12 src/Operations/ExecuteCqlQuery.cs
@@ -23,8 +23,8 @@ private CassandraColumnFamilySchema TryGetSchema(Apache.Cassandra.CqlResult resu
var keyName = CassandraColumnFamilySchema.DefaultKeyName.ToBigEndian();
var resultSchema = result.Schema;
- var colNameType = CassandraObject.ParseType(resultSchema.Default_name_type);
- var colValueType = CassandraObject.ParseType(resultSchema.Default_value_type);
+ var colNameType = CassandraType.GetCassandraType(resultSchema.Default_name_type);
+ var colValueType = CassandraType.GetCassandraType(resultSchema.Default_value_type);
var schema = new CassandraColumnFamilySchema();
schema.FamilyName = familyName;
@@ -36,13 +36,13 @@ private CassandraColumnFamilySchema TryGetSchema(Apache.Cassandra.CqlResult resu
var key = s.Key;
if (key.Length == 3 && key[0] == keyName[0] && key[1] == keyName[1] && key[2] == keyName[2])
{
- schema.KeyType = CassandraObject.ParseType(s.Value);
+ schema.KeyType = CassandraType.GetCassandraType(s.Value);
continue;
}
schema.Columns.Add(new CassandraColumnSchema {
- Name = CassandraObject.GetTypeFromDatabaseValue(s.Key, colNameType),
- ValueType = CassandraObject.ParseType(s.Value)
+ Name = CassandraObject.GetCassandraObjectFromDatabaseByteArray(s.Key, colNameType),
+ ValueType = CassandraType.GetCassandraType(s.Value)
});
}
@@ -87,7 +87,7 @@ private IEnumerable<ICqlRow> GetRows(Apache.Cassandra.CqlResult result)
foreach (var row in result.Rows)
yield return new FluentColumnFamily(
- CassandraObject.GetTypeFromDatabaseValue(row.Key, schema.KeyType),
+ CassandraObject.GetCassandraObjectFromDatabaseByteArray(row.Key, schema.KeyType),
familyName,
schema,
GetColumns(row, schema));
View
24 src/Operations/Helper.cs
@@ -76,8 +76,8 @@ public static CassandraSlicePredicate SetSchemaForSlicePredicate(CassandraSliceP
if (predicate is CassandraRangeSlicePredicate)
{
var x = (CassandraRangeSlicePredicate)predicate;
- var start = CassandraObject.GetTypeFromObject(x.Start, columnType);
- var finish = CassandraObject.GetTypeFromObject(x.Finish, columnType);
+ var start = CassandraObject.GetCassandraObjectFromObject(x.Start, columnType);
+ var finish = CassandraObject.GetCassandraObjectFromObject(x.Finish, columnType);
return new CassandraRangeSlicePredicate(start, finish, x.Reversed, x.Count);
}
@@ -87,7 +87,7 @@ public static CassandraSlicePredicate SetSchemaForSlicePredicate(CassandraSliceP
var cols = x.Columns.ToList();
for (int i = 0; i < cols.Count; i++)
- cols[i] = CassandraObject.GetTypeFromObject(cols[i], columnType);
+ cols[i] = CassandraObject.GetCassandraObjectFromObject(cols[i], columnType);
return new CassandraColumnSlicePredicate(cols);
}
@@ -190,7 +190,7 @@ public static FluentCounterColumn ConvertColumnToFluentCounterColumn(CounterColu
if (schema != null)
{
- var name = CassandraObject.GetTypeFromDatabaseValue(col.Name, schema.ColumnNameType);
+ var name = CassandraObject.GetCassandraObjectFromDatabaseByteArray(col.Name, schema.ColumnNameType);
colSchema = schema.Columns.Where(x => x.Name == name).FirstOrDefault();
if (colSchema == null)
@@ -203,7 +203,7 @@ public static FluentCounterColumn ConvertColumnToFluentCounterColumn(CounterColu
}
var fcol = new FluentCounterColumn(colSchema) {
- ColumnName = CassandraObject.GetTypeFromDatabaseValue(col.Name, colSchema.NameType),
+ ColumnName = CassandraObject.GetCassandraObjectFromDatabaseByteArray(col.Name, colSchema.NameType),
ColumnValue = col.Value
};
@@ -216,7 +216,7 @@ public static FluentColumn ConvertColumnToFluentColumn(Column col, CassandraColu
if (schema != null)
{
- var name = CassandraObject.GetTypeFromDatabaseValue(col.Name, schema.ColumnNameType);
+ var name = CassandraObject.GetCassandraObjectFromDatabaseByteArray(col.Name, schema.ColumnNameType);
colSchema = schema.Columns.Where(x => x.Name == name).FirstOrDefault();
if (colSchema == null)
@@ -229,8 +229,8 @@ public static FluentColumn ConvertColumnToFluentColumn(Column col, CassandraColu
}
var fcol = new FluentColumn(colSchema) {
- ColumnName = CassandraObject.GetTypeFromDatabaseValue(col.Name, colSchema.NameType),
- ColumnValue = CassandraObject.GetTypeFromDatabaseValue(col.Value, colSchema.ValueType),
+ ColumnName = CassandraObject.GetCassandraObjectFromDatabaseByteArray(col.Name, colSchema.NameType),
+ ColumnValue = CassandraObject.GetCassandraObjectFromDatabaseByteArray(col.Value, colSchema.ValueType),
ColumnTimestamp = FromTimestamp(col.Timestamp),
};
@@ -249,12 +249,12 @@ public static FluentSuperColumn ConvertSuperColumnToFluentCounterSuperColumn(Cou
if (schema != null)
superColSchema = new CassandraColumnSchema {
NameType = schema.SuperColumnNameType,
- Name = CassandraObject.GetTypeFromDatabaseValue(col.Name, schema.SuperColumnNameType),
+ Name = CassandraObject.GetCassandraObjectFromDatabaseByteArray(col.Name, schema.SuperColumnNameType),
ValueType = schema.ColumnNameType
};
var superCol = new FluentSuperColumn(superColSchema) {
- ColumnName = CassandraObject.GetTypeFromDatabaseValue(col.Name, superColSchema.NameType)
+ ColumnName = CassandraObject.GetCassandraObjectFromDatabaseByteArray(col.Name, superColSchema.NameType)
};
foreach (var xcol in col.Columns)
@@ -272,12 +272,12 @@ public static FluentSuperColumn ConvertSuperColumnToFluentSuperColumn(SuperColum
if (schema != null)
superColSchema = new CassandraColumnSchema {
NameType = schema.SuperColumnNameType,
- Name = CassandraObject.GetTypeFromDatabaseValue(col.Name, schema.SuperColumnNameType),
+ Name = CassandraObject.GetCassandraObjectFromDatabaseByteArray(col.Name, schema.SuperColumnNameType),
ValueType = schema.ColumnNameType
};
var superCol = new FluentSuperColumn(superColSchema) {
- ColumnName = CassandraObject.GetTypeFromDatabaseValue(col.Name, superColSchema.NameType)
+ ColumnName = CassandraObject.GetCassandraObjectFromDatabaseByteArray(col.Name, superColSchema.NameType)
};
foreach (var xcol in col.Columns)
View
2 src/Operations/MultiGetColumnFamilySlice.cs
@@ -32,7 +32,7 @@ public override IEnumerable<FluentColumnFamily> Execute()
foreach (var result in output)
{
- var key = CassandraObject.GetTypeFromDatabaseValue(result.Key, schema.KeyType);
+ var key = CassandraObject.GetCassandraObjectFromDatabaseByteArray(result.Key, schema.KeyType);
var r = new FluentColumnFamily(key, ColumnFamily.FamilyName, schema, result.Value.Select(col => {
return Helper.ConvertColumnToFluentColumn(col.Column, schema);
View
2 src/Operations/MultiGetSuperColumnFamilySlice.cs
@@ -33,7 +33,7 @@ public override IEnumerable<FluentSuperColumnFamily> Execute()
foreach (var result in output)
{
- var key = CassandraObject.GetTypeFromDatabaseValue(result.Key, schema.KeyType);
+ var key = CassandraObject.GetCassandraObjectFromDatabaseByteArray(result.Key, schema.KeyType);
var superColumns = (IEnumerable<FluentSuperColumn>)null;
View
29 src/Types/CassandraObject.cs
@@ -19,9 +19,9 @@ public CassandraObject GetValue(CassandraType type)
return this;
if (GetType() == typeof(BytesType))
- return GetTypeFromDatabaseValue((byte[])GetRawValue(), type);
+ return GetCassandraObjectFromDatabaseByteArray((byte[])GetRawValue(), type);
- return GetTypeFromObject(GetRawValue(), type);
+ return GetCassandraObjectFromObject(GetRawValue(), type);
}
public object GetValue(Type type)
@@ -87,7 +87,7 @@ private static T ConvertTo<T>(CassandraObject type)
private static CassandraObject ConvertFrom(object o)
{
- return GetTypeFromObject(o);
+ return GetCassandraObjectFromObject(o);
}
public static implicit operator CassandraObject(byte[] o) { return ConvertFrom(o); }
@@ -190,7 +190,7 @@ object IConvertible.ToType(Type conversionType, IFormatProvider provider)
#endregion
- public static CassandraObject GetTypeFromDatabaseValue(byte[] value, CassandraType cassandraType)
+ public static CassandraObject GetCassandraObjectFromDatabaseByteArray(byte[] value, CassandraType cassandraType)
{
var type = cassandraType.CreateInstance();
@@ -201,20 +201,21 @@ public static CassandraObject GetTypeFromDatabaseValue(byte[] value, CassandraTy
return type;
}
- public static CassandraObject GetTypeFromDatabaseValue(byte[] value, string type)
+ public static CassandraObject GetCassandraObjectFromDatabaseByteArray(byte[] value, string type)
{
- return GetTypeFromDatabaseValue(value, ParseType(type));
+ var cassandraType = CassandraType.GetCassandraType(type);
+ return GetCassandraObjectFromDatabaseByteArray(value, cassandraType);
}
- public static CassandraObject GetTypeFromObject(object obj)
+ public static CassandraObject GetCassandraObjectFromObject(object obj)
{
var sourceType = obj.GetType();
var cassandraType = CassandraType.GetCassandraType(sourceType);
- return GetTypeFromObject(obj, cassandraType);
+ return GetCassandraObjectFromObject(obj, cassandraType);
}
- public static CassandraObject GetTypeFromObject(object obj, CassandraType cassandraType)
+ public static CassandraObject GetCassandraObjectFromObject(object obj, CassandraType cassandraType)
{
if (obj == null)
return null;
@@ -231,14 +232,10 @@ public static CassandraObject GetTypeFromObject(object obj, CassandraType cassan
return type;
}
- public static CassandraObject GetTypeFromObject(object obj, string type)
+ public static CassandraObject GetCassandraObjectFromObject(object obj, string type)
{
- return GetTypeFromObject(obj, ParseType(type));
- }
-
- public static CassandraType ParseType(string type)
- {
- return new CassandraType(type);
+ var cassandraType = CassandraType.GetCassandraType(type);
+ return GetCassandraObjectFromObject(obj, cassandraType);
}
}
}
View
5 src/Types/CassandraType.cs
@@ -298,6 +298,11 @@ public static CassandraType GetCassandraType(Type sourceType)
return destinationType;
}
+ public static CassandraType GetCassandraType(string type)
+ {
+ return new CassandraType(type);
+ }
+
public static implicit operator CassandraType(Type type)
{
return GetCassandraType(type);
View
4 src/Types/CompositeType.cs
@@ -189,12 +189,12 @@ public override int GetHashCode()
public static implicit operator CompositeType(object[] s)
{
- return new CompositeType { _value = new List<CassandraObject>(s.Select(o => CassandraObject.GetTypeFromObject(o, CassandraType.BytesType))) };
+ return new CompositeType { _value = new List<CassandraObject>(s.Select(o => CassandraObject.GetCassandraObjectFromObject(o, CassandraType.BytesType))) };
}
public static implicit operator CompositeType(List<object> s)
{
- return new CompositeType { _value = new List<CassandraObject>(s.Select(o => CassandraObject.GetTypeFromObject(o, CassandraType.BytesType))) };
+ return new CompositeType { _value = new List<CassandraObject>(s.Select(o => CassandraObject.GetCassandraObjectFromObject(o, CassandraType.BytesType))) };
}
public static implicit operator byte[](CompositeType o) { return ConvertTo<byte[]>(o); }
View
2 src/Types/CompositeTypeConverter.cs
@@ -161,7 +161,7 @@ public List<CassandraObject> FromBigEndian(byte[] value, List<CassandraType> hin
var typeHint = (hints.Count >= (hintIndex + 1)) ? hints[hintIndex++] : CassandraType.BytesType;
bytes.Read(buffer, 0, length);
- var component = CassandraObject.GetTypeFromDatabaseValue(buffer, typeHint);
+ var component = CassandraObject.GetCassandraObjectFromDatabaseByteArray(buffer, typeHint);
components.Add(component);
// end of component
View
4 src/Types/DynamicCompositeType.cs
@@ -132,12 +132,12 @@ public override int GetHashCode()
public static implicit operator DynamicCompositeType(object[] s)
{
- return new DynamicCompositeType { _value = new List<CassandraObject>(s.Select(o => CassandraObject.GetTypeFromObject(o, CassandraType.BytesType))) };
+ return new DynamicCompositeType { _value = new List<CassandraObject>(s.Select(o => CassandraObject.GetCassandraObjectFromObject(o, CassandraType.BytesType))) };
}
public static implicit operator DynamicCompositeType(List<object> s)
{
- return new DynamicCompositeType { _value = new List<CassandraObject>(s.Select(o => CassandraObject.GetTypeFromObject(o, CassandraType.BytesType))) };
+ return new DynamicCompositeType { _value = new List<CassandraObject>(s.Select(o => CassandraObject.GetCassandraObjectFromObject(o, CassandraType.BytesType))) };
}
public static implicit operator byte[](DynamicCompositeType o) { return ConvertTo<byte[]>(o); }
View
2 src/Types/DynamicCompositeTypeConverter.cs
@@ -50,7 +50,7 @@ public override List<CassandraObject> ConvertFromInternal(object value)
var buffer = new byte[length];
bytes.Read(buffer, 0, length);
- components.Add(CassandraObject.GetTypeFromObject(buffer, type));
+ components.Add(CassandraObject.GetCassandraObjectFromObject(buffer, type));
// end of component
if (bytes.ReadByte() != 0)
View
44 test/FluentCassandra.Tests/Operations/CassandraIndexClauseTest.cs
@@ -68,9 +68,9 @@ public void SingleExpression()
var firstExpression = expressions[0];
Assert.NotNull(firstExpression);
- Assert.Equal(CassandraObject.GetTypeFromDatabaseValue(firstExpression.Column_name, typeof(BytesType)), (BytesType)columnName);
+ Assert.Equal(CassandraObject.GetCassandraObjectFromDatabaseByteArray(firstExpression.Column_name, typeof(BytesType)), (BytesType)columnName);
Assert.Equal(firstExpression.Op, IndexOperator.EQ);
- Assert.Equal(CassandraObject.GetTypeFromDatabaseValue(firstExpression.Value, typeof(BytesType)), (BytesType)columnValue);
+ Assert.Equal(CassandraObject.GetCassandraObjectFromDatabaseByteArray(firstExpression.Value, typeof(BytesType)), (BytesType)columnValue);
}
[Fact]
@@ -97,14 +97,14 @@ public void TwoExpressions()
var firstExpression = expressions[0];
Assert.NotNull(firstExpression);
- Assert.Equal(CassandraObject.GetTypeFromDatabaseValue(firstExpression.Column_name, typeof(BytesType)), (BytesType)columnName1);
+ Assert.Equal(CassandraObject.GetCassandraObjectFromDatabaseByteArray(firstExpression.Column_name, typeof(BytesType)), (BytesType)columnName1);
Assert.Equal(firstExpression.Op, IndexOperator.EQ);
- Assert.Equal(CassandraObject.GetTypeFromDatabaseValue(firstExpression.Value, typeof(BytesType)), (BytesType)columnValue1);
+ Assert.Equal(CassandraObject.GetCassandraObjectFromDatabaseByteArray(firstExpression.Value, typeof(BytesType)), (BytesType)columnValue1);
var secondExpression = expressions[1];
- Assert.Equal(CassandraObject.GetTypeFromDatabaseValue(secondExpression.Column_name, typeof(BytesType)), (BytesType)columnName2);
+ Assert.Equal(CassandraObject.GetCassandraObjectFromDatabaseByteArray(secondExpression.Column_name, typeof(BytesType)), (BytesType)columnName2);
Assert.Equal(secondExpression.Op, IndexOperator.GT);
- Assert.Equal(CassandraObject.GetTypeFromDatabaseValue(secondExpression.Value, typeof(BytesType)), (BytesType)columnValue2);
+ Assert.Equal(CassandraObject.GetCassandraObjectFromDatabaseByteArray(secondExpression.Value, typeof(BytesType)), (BytesType)columnValue2);
}
[Fact]
@@ -134,19 +134,19 @@ public void ThreeExpressions()
var firstExpression = expressions[0];
Assert.NotNull(firstExpression);
- Assert.Equal(CassandraObject.GetTypeFromDatabaseValue(firstExpression.Column_name, typeof(BytesType)), (BytesType)columnName1);
+ Assert.Equal(CassandraObject.GetCassandraObjectFromDatabaseByteArray(firstExpression.Column_name, typeof(BytesType)), (BytesType)columnName1);
Assert.Equal(firstExpression.Op, IndexOperator.EQ);
- Assert.Equal(CassandraObject.GetTypeFromDatabaseValue(firstExpression.Value, typeof(BytesType)), (BytesType)columnValue1);
+ Assert.Equal(CassandraObject.GetCassandraObjectFromDatabaseByteArray(firstExpression.Value, typeof(BytesType)), (BytesType)columnValue1);
var secondExpression = expressions[1];
- Assert.Equal(CassandraObject.GetTypeFromDatabaseValue(secondExpression.Column_name, typeof(BytesType)), (BytesType)columnName2);
+ Assert.Equal(CassandraObject.GetCassandraObjectFromDatabaseByteArray(secondExpression.Column_name, typeof(BytesType)), (BytesType)columnName2);
Assert.Equal(secondExpression.Op, IndexOperator.GT);
- Assert.Equal(CassandraObject.GetTypeFromDatabaseValue(secondExpression.Value, typeof(BytesType)), (BytesType)columnValue2);
+ Assert.Equal(CassandraObject.GetCassandraObjectFromDatabaseByteArray(secondExpression.Value, typeof(BytesType)), (BytesType)columnValue2);
var thirdExpression = expressions[2];
- Assert.Equal(CassandraObject.GetTypeFromDatabaseValue(thirdExpression.Column_name, typeof(BytesType)), (BytesType)columnName3);
+ Assert.Equal(CassandraObject.GetCassandraObjectFromDatabaseByteArray(thirdExpression.Column_name, typeof(BytesType)), (BytesType)columnName3);
Assert.Equal(secondExpression.Op, IndexOperator.GT);
- Assert.Equal(CassandraObject.GetTypeFromDatabaseValue(thirdExpression.Value, typeof(BytesType)), (BytesType)columnValue3);
+ Assert.Equal(CassandraObject.GetCassandraObjectFromDatabaseByteArray(thirdExpression.Value, typeof(BytesType)), (BytesType)columnValue3);
}
[Fact]
@@ -170,9 +170,9 @@ public void EqualsExpression()
var firstExpression = expressions[0];
Assert.NotNull(firstExpression);
- Assert.Equal(CassandraObject.GetTypeFromDatabaseValue(firstExpression.Column_name, typeof(BytesType)), (BytesType)columnName);
+ Assert.Equal(CassandraObject.GetCassandraObjectFromDatabaseByteArray(firstExpression.Column_name, typeof(BytesType)), (BytesType)columnName);
Assert.Equal(firstExpression.Op, IndexOperator.EQ);
- Assert.Equal(CassandraObject.GetTypeFromDatabaseValue(firstExpression.Value, typeof(BytesType)), (BytesType)columnValue);
+ Assert.Equal(CassandraObject.GetCassandraObjectFromDatabaseByteArray(firstExpression.Value, typeof(BytesType)), (BytesType)columnValue);
}
[Fact]
@@ -196,9 +196,9 @@ public void GreaterThanExpression()
var firstExpression = expressions[0];
Assert.NotNull(firstExpression);
- Assert.Equal(CassandraObject.GetTypeFromDatabaseValue(firstExpression.Column_name, typeof(BytesType)), (BytesType)columnName);
+ Assert.Equal(CassandraObject.GetCassandraObjectFromDatabaseByteArray(firstExpression.Column_name, typeof(BytesType)), (BytesType)columnName);
Assert.Equal(firstExpression.Op, IndexOperator.GT);
- Assert.Equal(CassandraObject.GetTypeFromDatabaseValue(firstExpression.Value, typeof(BytesType)), (BytesType)columnValue);
+ Assert.Equal(CassandraObject.GetCassandraObjectFromDatabaseByteArray(firstExpression.Value, typeof(BytesType)), (BytesType)columnValue);
}
[Fact]
@@ -222,9 +222,9 @@ public void GreaterThanOrEqualExpression()
var firstExpression = expressions[0];
Assert.NotNull(firstExpression);
- Assert.Equal(CassandraObject.GetTypeFromDatabaseValue(firstExpression.Column_name, typeof(BytesType)), (BytesType)columnName);
+ Assert.Equal(CassandraObject.GetCassandraObjectFromDatabaseByteArray(firstExpression.Column_name, typeof(BytesType)), (BytesType)columnName);
Assert.Equal(firstExpression.Op, IndexOperator.GTE);
- Assert.Equal(CassandraObject.GetTypeFromDatabaseValue(firstExpression.Value, typeof(BytesType)), (BytesType)columnValue);
+ Assert.Equal(CassandraObject.GetCassandraObjectFromDatabaseByteArray(firstExpression.Value, typeof(BytesType)), (BytesType)columnValue);
}
[Fact]
@@ -248,9 +248,9 @@ public void LessThanExpression()
var firstExpression = expressions[0];
Assert.NotNull(firstExpression);
- Assert.Equal(CassandraObject.GetTypeFromDatabaseValue(firstExpression.Column_name, typeof(BytesType)), (BytesType)columnName);
+ Assert.Equal(CassandraObject.GetCassandraObjectFromDatabaseByteArray(firstExpression.Column_name, typeof(BytesType)), (BytesType)columnName);
Assert.Equal(firstExpression.Op, IndexOperator.LT);
- Assert.Equal(CassandraObject.GetTypeFromDatabaseValue(firstExpression.Value, typeof(BytesType)), (BytesType)columnValue);
+ Assert.Equal(CassandraObject.GetCassandraObjectFromDatabaseByteArray(firstExpression.Value, typeof(BytesType)), (BytesType)columnValue);
}
[Fact]
@@ -274,9 +274,9 @@ public void LessThanOrEqualExpression()
var firstExpression = expressions[0];
Assert.NotNull(firstExpression);
- Assert.Equal(CassandraObject.GetTypeFromDatabaseValue(firstExpression.Column_name, typeof(BytesType)), (BytesType)columnName);
+ Assert.Equal(CassandraObject.GetCassandraObjectFromDatabaseByteArray(firstExpression.Column_name, typeof(BytesType)), (BytesType)columnName);
Assert.Equal(firstExpression.Op, IndexOperator.LTE);
- Assert.Equal(CassandraObject.GetTypeFromDatabaseValue(firstExpression.Value, typeof(BytesType)), (BytesType)columnValue);
+ Assert.Equal(CassandraObject.GetCassandraObjectFromDatabaseByteArray(firstExpression.Value, typeof(BytesType)), (BytesType)columnValue);
}
}
}

0 comments on commit f3bc872

Please sign in to comment.