Permalink
Browse files

Added some linq unit tests

  • Loading branch information...
rsparkyc committed Aug 2, 2012
1 parent 98a0d47 commit 69107d4301a5d7e12084576583c83500f040cdae
@@ -222,5 +222,22 @@ public void ORDER_BY_DESC()
AreEqual(expected, actual);
}
+
+ [Fact]
+ public void OTHER_LINQ_SYNTAX() {
+ var expected = "SELECT * FROM Users WHERE Id = 1234";
+
+ var columnName = "Id";
+
+ IQueryable<ICqlRow> query = _family;
+
+ query = query.Where(q => q[columnName] == 1234);
+
+ var actual = query.ToString();
+
+ AreEqual(expected, actual);
+
+
+ }
}
}
@@ -257,5 +257,18 @@ public void ORDER_BY_DESC()
AreEqual(expected, actual);
}
+
+ [Fact]
+ public void CHAINING_WHERE_CLAUSE()
+ {
+ var expected = "SELECT * FROM Users WHERE Id = 1234 AND Age = 10";
+
+ IQueryable<ICqlRow> query = _family;
+ query = query.Where(q => q["Id"] == 1234).Where(q => q["Age"] == 10);
+
+ var actual = query.ToString();
+ AreEqual(expected, actual);
+ }
+
}
}

0 comments on commit 69107d4

Please sign in to comment.