public void FindItemsWhereArrayContainsShouldConstructValidSqlQuery() { // Arrange var ids = new List <string>() { "guid1", "guid2", "guid3" }; string query = @"SELECT * FROM c WHERE ARRAY_CONTAINS(c.TopicTags, { 'Id' : 'guid1'})OR ARRAY_CONTAINS(c.TopicTags, { 'Id' : 'guid2'})OR ARRAY_CONTAINS(c.TopicTags, { 'Id' : 'guid3'})"; // Acts dynamicQueries.FindItemsWhereArrayContainsAsync("TopicsCollections", "TopicTags", "Id", ids); // Assert cosmosDbService.Received().QueryItemsAsync(Arg.Any <string>(), query); }
public async Task <dynamic> GetTopicsAsync(string stateCode) { return(await dbClient.FindItemsWhereArrayContainsAsync(dbSettings.TopicsCollectionId, Constants.Location, Constants.StateCode, stateCode, true)); }