public void FindItemsWhereArrayContainsWithAndClauseAsyncShouldVaildSqlQuery() { // Arrange var ids = new List <string>() { "guid1" }; ResourceFilter resourceFilter = new ResourceFilter { TopicIds = ids, PageNumber = 0, ResourceType = "All" }; string query = @"SELECT * FROM c WHERE ( ARRAY_CONTAINS(c.topicTags, { 'id' : 'guid1'})) AND (c.resourceType != 'Guided Assistant' OR (c.resourceType = 'Guided Assistant' AND c.isActive = true))"; //Act dynamicQueries.FindItemsWhereArrayContainsWithAndClauseAsync("topicTags", "id", "resourceType", resourceFilter); // Assert cosmosDbService.Received().QueryPagedResourcesAsync(query, ""); }
public async Task <dynamic> ApplyPaginationAsync(ResourceFilter resourceFilter) { PagedResources pagedResources = await dbClient.FindItemsWhereArrayContainsWithAndClauseAsync("topicTags", "id", "resourceType", resourceFilter); return(pagedResources); }