Browse Source

Ids test

pull/922/head
Sebastian 3 years ago
parent
commit
6ee1ffb35a
  1. 46
      backend/tools/TestSuite/TestSuite.ApiTests/ContentQueryTests.cs

46
backend/tools/TestSuite/TestSuite.ApiTests/ContentQueryTests.cs

@ -79,7 +79,7 @@ namespace TestSuite.ApiTests
{ {
new new
{ {
path = "data.number.iv", order = "ascending" path = "data.number.iv"
} }
} }
} }
@ -111,7 +111,7 @@ namespace TestSuite.ApiTests
{ {
new new
{ {
path = "data.number.iv", order = "ascending" path = "data.number.iv"
} }
}, },
skip = 5 skip = 5
@ -145,7 +145,7 @@ namespace TestSuite.ApiTests
{ {
new new
{ {
path = "data.number.iv", order = "ascending" path = "data.number.iv"
} }
}, },
top = 5 top = 5
@ -178,7 +178,7 @@ namespace TestSuite.ApiTests
{ {
new new
{ {
path = "data.number.iv", order = "ascending" path = "data.number.iv"
} }
}, },
filter = new filter = new
@ -218,7 +218,7 @@ namespace TestSuite.ApiTests
{ {
new new
{ {
path = "data.json.iv.nested1.nested2", order = "ascending" path = "data.json.iv.nested1.nested2"
} }
}, },
filter = new filter = new
@ -423,6 +423,42 @@ namespace TestSuite.ApiTests
Assert.Equal(555, value); Assert.Equal(555, value);
} }
[Fact]
public async Task Should_return_items_by_ids()
{
var q0 = new ContentQuery { Filter = "data/number/iv gt 3 and data/number/iv lt 7", OrderBy = "data/number/iv asc" };
var items_0 = await _.Contents.GetAsync(q0);
var q1 = new ContentQuery
{
JsonQuery = new
{
sort = new[]
{
new
{
path = "data.number.iv"
}
},
filter = new
{
or = items_0.Items.Select(x => new
{
path = "id",
op = "eq",
value = x.Id
}).ToArray()
}
}
};
var items_1 = await _.Contents.GetAsync(q1);
AssertItems(items_0, 3, new[] { 4, 5, 6 });
AssertItems(items_1, 3, new[] { 4, 5, 6 });
}
[Fact] [Fact]
public async Task Should_create_and_query_with_variable_graphql() public async Task Should_create_and_query_with_variable_graphql()
{ {

Loading…
Cancel
Save