|
|
@ -67,7 +67,7 @@ namespace Squidex.Infrastructure.Queries |
|
|
[InlineData("created")] |
|
|
[InlineData("created")] |
|
|
[InlineData("createdNullable")] |
|
|
[InlineData("createdNullable")] |
|
|
[InlineData("properties/datetime")] |
|
|
[InlineData("properties/datetime")] |
|
|
[InlineData("properties/nested/dateime")] |
|
|
[InlineData("properties/nested/datetime")] |
|
|
public void Should_parse_filter_when_type_is_datetime(string field) |
|
|
public void Should_parse_filter_when_type_is_datetime(string field) |
|
|
{ |
|
|
{ |
|
|
var i = _Q($"$filter={field} eq 1988-01-19T12:00:00Z"); |
|
|
var i = _Q($"$filter={field} eq 1988-01-19T12:00:00Z"); |
|
|
@ -76,6 +76,19 @@ namespace Squidex.Infrastructure.Queries |
|
|
Assert.Equal(o, i); |
|
|
Assert.Equal(o, i); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
[Theory] |
|
|
|
|
|
[InlineData("created")] |
|
|
|
|
|
[InlineData("createdNullable")] |
|
|
|
|
|
[InlineData("properties/datetime")] |
|
|
|
|
|
[InlineData("properties/nested/datetime")] |
|
|
|
|
|
public void Should_parse_filter_when_type_is_datetime_and_value_is_null(string field) |
|
|
|
|
|
{ |
|
|
|
|
|
var i = _Q($"$filter={field} eq null"); |
|
|
|
|
|
var o = _C($"Filter: {field} == null"); |
|
|
|
|
|
|
|
|
|
|
|
Assert.Equal(o, i); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
[Fact] |
|
|
[Fact] |
|
|
public void Should_parse_filter_when_type_is_datetime_list() |
|
|
public void Should_parse_filter_when_type_is_datetime_list() |
|
|
{ |
|
|
{ |
|
|
@ -129,6 +142,19 @@ namespace Squidex.Infrastructure.Queries |
|
|
Assert.Equal(o, i); |
|
|
Assert.Equal(o, i); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
[Theory] |
|
|
|
|
|
[InlineData("id")] |
|
|
|
|
|
[InlineData("idNullable")] |
|
|
|
|
|
[InlineData("properties/uid")] |
|
|
|
|
|
[InlineData("properties/nested/guid")] |
|
|
|
|
|
public void Should_parse_filter_when_type_is_guid_and_value_is_null(string field) |
|
|
|
|
|
{ |
|
|
|
|
|
var i = _Q($"$filter={field} eq null"); |
|
|
|
|
|
var o = _C($"Filter: {field} == null"); |
|
|
|
|
|
|
|
|
|
|
|
Assert.Equal(o, i); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
[Fact] |
|
|
[Fact] |
|
|
public void Should_parse_filter_when_type_is_guid_list() |
|
|
public void Should_parse_filter_when_type_is_guid_list() |
|
|
{ |
|
|
{ |
|
|
@ -182,6 +208,19 @@ namespace Squidex.Infrastructure.Queries |
|
|
Assert.Equal(o, i); |
|
|
Assert.Equal(o, i); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
[Theory] |
|
|
|
|
|
[InlineData("isComicFigure")] |
|
|
|
|
|
[InlineData("isComicFigureNullable")] |
|
|
|
|
|
[InlineData("properties/boolean")] |
|
|
|
|
|
[InlineData("properties/nested/boolean")] |
|
|
|
|
|
public void Should_parse_filter_when_type_is_boolean_and_value_is_null(string field) |
|
|
|
|
|
{ |
|
|
|
|
|
var i = _Q($"$filter={field} eq null"); |
|
|
|
|
|
var o = _C($"Filter: {field} == null"); |
|
|
|
|
|
|
|
|
|
|
|
Assert.Equal(o, i); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
[Fact] |
|
|
[Fact] |
|
|
public void Should_parse_filter_when_type_is_boolean_list() |
|
|
public void Should_parse_filter_when_type_is_boolean_list() |
|
|
{ |
|
|
{ |
|
|
|