|
|
@ -38,6 +38,16 @@ namespace Squidex.Infrastructure.Queries |
|
|
Assert.Equal(expected, filter.ToString()); |
|
|
Assert.Equal(expected, filter.ToString()); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
[Fact] |
|
|
|
|
|
public void Should_convert_comparison_without_operator() |
|
|
|
|
|
{ |
|
|
|
|
|
var json = new { path = "property" }; |
|
|
|
|
|
|
|
|
|
|
|
var filter = SerializeAndDeserialize(json); |
|
|
|
|
|
|
|
|
|
|
|
Assert.Equal("property == null", filter.ToString()); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
[Fact] |
|
|
[Fact] |
|
|
public void Should_convert_comparison_empty() |
|
|
public void Should_convert_comparison_empty() |
|
|
{ |
|
|
{ |
|
|
@ -141,14 +151,6 @@ namespace Squidex.Infrastructure.Queries |
|
|
Assert.ThrowsAny<JsonException>(() => SerializeAndDeserialize(json)); |
|
|
Assert.ThrowsAny<JsonException>(() => SerializeAndDeserialize(json)); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
[Fact] |
|
|
|
|
|
public void Should_throw_exception_for_missing_operator() |
|
|
|
|
|
{ |
|
|
|
|
|
var json = new { path = "property", value = 12 }; |
|
|
|
|
|
|
|
|
|
|
|
Assert.ThrowsAny<JsonException>(() => SerializeAndDeserialize(json)); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
[Fact] |
|
|
[Fact] |
|
|
public void Should_throw_exception_for_missing_value() |
|
|
public void Should_throw_exception_for_missing_value() |
|
|
{ |
|
|
{ |
|
|
|