From 84d8898beba9bb99b314d68f158f47aaf8d07c32 Mon Sep 17 00:00:00 2001 From: Sebastian Stehle Date: Wed, 31 Jan 2018 12:34:25 +0100 Subject: [PATCH] Tests fixed --- .../Contents/OData/ODataQueryTests.cs | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/tests/Squidex.Domain.Apps.Entities.Tests/Contents/OData/ODataQueryTests.cs b/tests/Squidex.Domain.Apps.Entities.Tests/Contents/OData/ODataQueryTests.cs index 8c2bbf3bd..06f8f0ade 100644 --- a/tests/Squidex.Domain.Apps.Entities.Tests/Contents/OData/ODataQueryTests.cs +++ b/tests/Squidex.Domain.Apps.Entities.Tests/Contents/OData/ODataQueryTests.cs @@ -23,6 +23,7 @@ using Squidex.Domain.Apps.Entities.MongoDb.Contents.Visitors; using Squidex.Domain.Apps.Entities.Schemas; using Squidex.Infrastructure; using Squidex.Infrastructure.MongoDb; +using Squidex.Infrastructure.MongoDb.OData; using Xunit; namespace Squidex.Domain.Apps.Entities.Contents.OData @@ -307,7 +308,7 @@ namespace Squidex.Domain.Apps.Entities.Contents.OData var parser = edmModel.ParseQuery("$top=3"); var cursor = A.Fake>(); - cursor.Take(parser); + cursor.ContentTake(parser); A.CallTo(() => cursor.Limit(3)).MustHaveHappened(); } @@ -318,7 +319,7 @@ namespace Squidex.Domain.Apps.Entities.Contents.OData var parser = edmModel.ParseQuery("$top=300"); var cursor = A.Fake>(); - cursor.Take(parser); + cursor.ContentTake(parser); A.CallTo(() => cursor.Limit(200)).MustHaveHappened(); } @@ -329,7 +330,7 @@ namespace Squidex.Domain.Apps.Entities.Contents.OData var parser = edmModel.ParseQuery(string.Empty); var cursor = A.Fake>(); - cursor.Take(parser); + cursor.ContentTake(parser); A.CallTo(() => cursor.Limit(20)).MustHaveHappened(); } @@ -340,7 +341,7 @@ namespace Squidex.Domain.Apps.Entities.Contents.OData var parser = edmModel.ParseQuery("$skip=3"); var cursor = A.Fake>(); - cursor.Skip(parser); + cursor.ContentSkip(parser); A.CallTo(() => cursor.Skip(3)).MustHaveHappened(); } @@ -351,7 +352,7 @@ namespace Squidex.Domain.Apps.Entities.Contents.OData var parser = edmModel.ParseQuery(string.Empty); var cursor = A.Fake>(); - cursor.Take(parser); + cursor.ContentSkip(parser); A.CallTo(() => cursor.Skip(A.Ignored)).MustNotHaveHappened(); } @@ -374,7 +375,7 @@ namespace Squidex.Domain.Apps.Entities.Contents.OData i = sortDefinition.Render(serializer, registry).ToString(); }); - cursor.Sort(parser, schemaDef); + cursor.ContentSort(parser, FindExtensions.CreatePropertyCalculator(schemaDef)); return i; } @@ -383,7 +384,9 @@ namespace Squidex.Domain.Apps.Entities.Contents.OData { var parser = edmModel.ParseQuery(value); - var query = FilterBuilder.Build(parser, schemaDef).Filter.Render(serializer, registry).ToString(); + var query = + parser.BuildFilter(FindExtensions.CreatePropertyCalculator(schemaDef)) + .Filter.Render(serializer, registry).ToString(); return query; }