public void Expression_Method_Invalid_Call() { Person person = new Person(); Exception ex = Assert.Throws <InvalidOperationException>(() => SqlExp.IsNotNull(person.Name)); Assert.Equal("Only for expressions.", ex.Message); }
public void Expression_Method_Nested_Deep() { Person2 person = null; IOperator op = sql.Op(() => SqlExp.IsNotNull(person.Address.City.Country.Name)); QueryResult result = engine.Compile(op); Assert.Equal("\"person\".\"AddressCityCountryName\" IS NOT NULL", result.Sql); Assert.Equal(new Dictionary <string, object>(), result.Parameters); }
public void Expression_Method_ForeignKey() { Person person = null; IOperator op = sql.Op(() => SqlExp.IsNotNull(person.Department.Id)); QueryResult result = engine.Compile(op); Assert.Equal("\"person\".\"DepartmentId\" IS NOT NULL", result.Sql); Assert.Equal(new Dictionary <string, object>(), result.Parameters); }