Any \ Exists ignores bad \ multiple SimpleExpressions #266

Closed
hmobius opened this Issue Mar 26, 2013 · 1 comment

Comments

Projects
None yet
2 participants
@hmobius

hmobius commented Mar 26, 2013

A call to Add() or Exists() simply ignores any parameters if they are either

  • malformed SimpleExpressions
  • more than one SimpleExpression, good or bad.

Suggest that the following tests should pass.

[Test]
public void ExistsWithStringParameterThrowsBadExpressionException()
{
   Assert.Throws<BadExpressionException>(() => _db.Users.Exists("Answer").ToList());
}
[Test]
public void ExistsWithColumnNameParameterThrowsBadExpressionException()
{
   Assert.Throws<BadExpressionException>(() => _db.Users.Exists(_db.Users.Id).ToList());
}
[Test]
public void ExistsWithMoreThanOneParameterThrowsArgumentException()
{
   Assert.Throws<ArgumentException>(() => _db.Users.Exists(_db.Users.Id == 1, _db.Users.Id > 0).ToList());
}
@markrendle

This comment has been minimized.

Show comment Hide comment
@markrendle

markrendle May 21, 2013

Owner

Fixed

Owner

markrendle commented May 21, 2013

Fixed

@markrendle markrendle closed this May 21, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment