Skip to content
This repository has been archived by the owner on May 25, 2021. It is now read-only.

Commit

Permalink
Merge pull request #43 from rsparkyc/master
Browse files Browse the repository at this point in the history
Some linq unit tests
  • Loading branch information
nberardi committed Aug 20, 2012
2 parents 98a0d47 + 69107d4 commit 2bfc406
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/FluentCassandra.Tests/Linq/LinqToCqlObjectsTests.cs
Expand Up @@ -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);


}
}
}
13 changes: 13 additions & 0 deletions test/FluentCassandra.Tests/Linq/LinqToCqlTests.cs
Expand Up @@ -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 2bfc406

Please sign in to comment.