public void StringToLowerAndContains() { var x = ODataDynamic.Expression; var filter = x.ProductName.ToLower().Contains("Chai"); Assert.Equal(FormatSettings.GetContainsFormat("tolower(ProductName)", "Chai"), filter.AsString(_session)); }
public void StringNotContains() { var x = ODataDynamic.Expression; var filter = !x.ProductName.Contains("ai"); Assert.Equal(string.Format("not {0}", FormatSettings.GetContainsFormat("ProductName", "ai")), filter.AsString(_session)); }
public void StringContainsEqualFalse() { var x = ODataDynamic.Expression; var filter = x.ProductName.Contains("ai") == false; Assert.Equal(string.Format("{0} eq false", FormatSettings.GetContainsFormat("ProductName", "ai")), filter.AsString(_session)); }
public void StringContainsEqualTrue() { var x = ODataDynamic.Expression; var filter = x.ProductName.Contains("ai") == true; Assert.Equal($"{FormatSettings.GetContainsFormat("ProductName", "ai")} eq true", filter.AsString(_session)); }
public void StringToLowerAndContains() { Expression <Func <TestEntity, bool> > filter = x => x.ProductName.ToLower().Contains("Chai"); Assert.Equal(FormatSettings.GetContainsFormat("tolower(ProductName)", "Chai"), ODataExpression.FromLinqExpression(filter).AsString(_session)); }
public void StringNotContains() { Expression <Func <TestEntity, bool> > filter = x => !x.ProductName.Contains("ai"); Assert.Equal($"not {FormatSettings.GetContainsFormat("ProductName", "ai")}", ODataExpression.FromLinqExpression(filter).AsString(_session)); }
public void StringContainsEqualFalse() { Expression <Func <TestEntity, bool> > filter = x => x.ProductName.Contains("ai") == false; Assert.Equal($"{FormatSettings.GetContainsFormat("ProductName", "ai")} eq false", ODataExpression.FromLinqExpression(filter).AsString(_session)); }
public void StringContainsEqualTrue() { Expression <Func <TestEntity, bool> > filter = x => x.ProductName.Contains("ai") == true; Assert.Equal(string.Format("{0} eq true", FormatSettings.GetContainsFormat("ProductName", "ai")), ODataExpression.FromLinqExpression(filter).AsString(_session)); }