public void TestInvoke_two_arguments() { SqlExpressionExtension .Invoke("max", new[] { Sql.Int(1), Sql.Int(2) }) .ToEmbeddedString() .ShouldEqual("max ( 1 , 2 )"); }
public void TestInvoke_no_arguments() { SqlExpressionExtension .Invoke("f", Enumerable.Empty <ScalarSqlExpression>()) .ToEmbeddedString() .ShouldEqual("f ( )"); }
public void LikeTest() { Assert.AreEqual <string>("(13) LIKE (14)", SqlExpressionExtension.Like(new SqlStringExpression("13"), new SqlStringExpression("14")).SqlString); }
public void NotTest() { Assert.AreEqual <string>("NOT (13)", SqlExpressionExtension.Not(new SqlStringExpression("13")).SqlString); }
public void InTest() { Assert.AreEqual <string>("(ID) IN (13, 14)", SqlExpressionExtension.In(new SqlStringExpression("ID"), new SqlStringExpression("13"), new SqlStringExpression("14")).SqlString); }
public void AndTest() { Assert.AreEqual <string>("(13) AND (14)", SqlExpressionExtension.And(new SqlStringExpression("13"), new SqlStringExpression("14")).SqlString); }
public void OrTest() { Assert.AreEqual <string>("(13) OR (14)", SqlExpressionExtension.Or(new SqlStringExpression("13"), new SqlStringExpression("14")).SqlString); }
public void AssignTest() { Assert.AreEqual <string>("13 = (14)", SqlExpressionExtension.Assign(new SqlStringExpression("13"), new SqlStringExpression("14")).SqlString); }
public void IsNullTest() { Assert.AreEqual <string>("(ID) IS NULL", SqlExpressionExtension.IsNull(new SqlStringExpression("ID")).SqlString); }
public void MultiplyTest() { Assert.AreEqual <string>("(13) * (14)", SqlExpressionExtension.Multiply(new SqlStringExpression("13"), new SqlStringExpression("14")).SqlString); }
public void ModeTest() { Assert.AreEqual <string>("(13) % (14)", SqlExpressionExtension.Mode(new SqlStringExpression("13"), new SqlStringExpression("14")).SqlString); }
public void SubtractTest() { Assert.AreEqual <string>("(13) - (14)", SqlExpressionExtension.Subtract(new SqlStringExpression("13"), new SqlStringExpression("14")).SqlString); }
public void ExclusiveOrTest() { Assert.AreEqual <string>("^ (13)", SqlExpressionExtension.ExclusiveOr(new SqlStringExpression("13")).SqlString); }
public void LessEqualTest() { Assert.AreEqual <string>("(13) <= (14)", SqlExpressionExtension.LessEqual(new SqlStringExpression("13"), new SqlStringExpression("14")).SqlString); }
public void GreaterThanTest() { Assert.AreEqual <string>("(13) > (14)", SqlExpressionExtension.GreaterThan(new SqlStringExpression("13"), new SqlStringExpression("14")).SqlString); }
public void BetweenTest() { Assert.AreEqual <string>("(ID) BETWEEN (13) AND (14)", SqlExpressionExtension.Between(new SqlStringExpression("ID"), new SqlStringExpression("13"), new SqlStringExpression("14")).SqlString); }