integration tested index management functionality

This commit is contained in:
alexandre-spieser
2018-10-07 19:05:59 +01:00
parent fd8f98e375
commit 0cf24b1dcf
15 changed files with 1103 additions and 199 deletions
@@ -3,6 +3,7 @@ using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Linq.Expressions;
using System.Runtime.CompilerServices;
using System.Threading;
using System.Threading.Tasks;
@@ -1046,6 +1047,25 @@ namespace CoreIntegrationTests.Infrastructure
await SUT.DropIndexAsync<T, TKey>(expectedIndexName, PartitionKey);
}
[Fact]
public async Task CreateCombinedTextIndexAsync()
{
// Arrange
const string expectedIndexName = "SomeContent4_text_SomeContent5_text";
// Act
Expression<Func<T, object>> ex = x => x.SomeContent4;
Expression<Func<T, object>> ex2 = x => x.SomeContent5;
var result = await SUT.CreateCombinedTextIndexAsync<T, TKey>(new[] { ex, ex2 }, null, PartitionKey);
// Assert
var listOfIndexNames = await SUT.GetIndexesNamesAsync<T, TKey>(PartitionKey);
Assert.Contains(expectedIndexName, listOfIndexNames);
// Cleanup
await SUT.DropIndexAsync<T, TKey>(expectedIndexName, PartitionKey);
}
#endregion Index Management
#region Test Utils