fixed some tests
This commit is contained in:
@@ -768,7 +768,8 @@ namespace CoreIntegrationTests.Infrastructure
|
|||||||
var criteria = $"{GetTestName()}.{DocumentTypeName}.{Guid.NewGuid()}";
|
var criteria = $"{GetTestName()}.{DocumentTypeName}.{Guid.NewGuid()}";
|
||||||
var documents = CreateTestDocuments(5);
|
var documents = CreateTestDocuments(5);
|
||||||
var i = 1;
|
var i = 1;
|
||||||
documents.ForEach(e => {
|
documents.ForEach(e =>
|
||||||
|
{
|
||||||
e.Nested.SomeDate = e.Nested.SomeDate.AddDays(i++);
|
e.Nested.SomeDate = e.Nested.SomeDate.AddDays(i++);
|
||||||
e.SomeContent = criteria;
|
e.SomeContent = criteria;
|
||||||
});
|
});
|
||||||
@@ -790,7 +791,8 @@ namespace CoreIntegrationTests.Infrastructure
|
|||||||
var criteria = $"{GetTestName()}.{DocumentTypeName}.{Guid.NewGuid()}";
|
var criteria = $"{GetTestName()}.{DocumentTypeName}.{Guid.NewGuid()}";
|
||||||
var documents = CreateTestDocuments(5);
|
var documents = CreateTestDocuments(5);
|
||||||
var i = 1;
|
var i = 1;
|
||||||
documents.ForEach(e => {
|
documents.ForEach(e =>
|
||||||
|
{
|
||||||
e.Nested.SomeDate = e.Nested.SomeDate.AddDays(i++);
|
e.Nested.SomeDate = e.Nested.SomeDate.AddDays(i++);
|
||||||
e.SomeContent = criteria;
|
e.SomeContent = criteria;
|
||||||
});
|
});
|
||||||
@@ -812,7 +814,8 @@ namespace CoreIntegrationTests.Infrastructure
|
|||||||
var criteria = $"{GetTestName()}.{DocumentTypeName}.{Guid.NewGuid()}";
|
var criteria = $"{GetTestName()}.{DocumentTypeName}.{Guid.NewGuid()}";
|
||||||
var documents = CreateTestDocuments(5);
|
var documents = CreateTestDocuments(5);
|
||||||
var i = 1;
|
var i = 1;
|
||||||
documents.ForEach(e => {
|
documents.ForEach(e =>
|
||||||
|
{
|
||||||
e.Nested.SomeDate = e.Nested.SomeDate.AddDays(i++);
|
e.Nested.SomeDate = e.Nested.SomeDate.AddDays(i++);
|
||||||
e.SomeContent = criteria;
|
e.SomeContent = criteria;
|
||||||
});
|
});
|
||||||
@@ -834,7 +837,8 @@ namespace CoreIntegrationTests.Infrastructure
|
|||||||
var criteria = $"{GetTestName()}.{DocumentTypeName}.{Guid.NewGuid()}";
|
var criteria = $"{GetTestName()}.{DocumentTypeName}.{Guid.NewGuid()}";
|
||||||
var documents = CreateTestDocuments(5);
|
var documents = CreateTestDocuments(5);
|
||||||
var i = 1;
|
var i = 1;
|
||||||
documents.ForEach(e => {
|
documents.ForEach(e =>
|
||||||
|
{
|
||||||
e.Nested.SomeDate = e.Nested.SomeDate.AddDays(i++);
|
e.Nested.SomeDate = e.Nested.SomeDate.AddDays(i++);
|
||||||
e.SomeContent = criteria;
|
e.SomeContent = criteria;
|
||||||
});
|
});
|
||||||
@@ -856,7 +860,8 @@ namespace CoreIntegrationTests.Infrastructure
|
|||||||
var criteria = $"{GetTestName()}.{DocumentTypeName}.{Guid.NewGuid()}";
|
var criteria = $"{GetTestName()}.{DocumentTypeName}.{Guid.NewGuid()}";
|
||||||
var documents = CreateTestDocuments(5);
|
var documents = CreateTestDocuments(5);
|
||||||
var i = 1;
|
var i = 1;
|
||||||
documents.ForEach(e => {
|
documents.ForEach(e =>
|
||||||
|
{
|
||||||
e.Nested.SomeDate = e.Nested.SomeDate.AddDays(i++);
|
e.Nested.SomeDate = e.Nested.SomeDate.AddDays(i++);
|
||||||
e.SomeContent = criteria;
|
e.SomeContent = criteria;
|
||||||
});
|
});
|
||||||
@@ -878,7 +883,8 @@ namespace CoreIntegrationTests.Infrastructure
|
|||||||
var criteria = $"{GetTestName()}.{DocumentTypeName}.{Guid.NewGuid()}";
|
var criteria = $"{GetTestName()}.{DocumentTypeName}.{Guid.NewGuid()}";
|
||||||
var documents = CreateTestDocuments(5);
|
var documents = CreateTestDocuments(5);
|
||||||
var i = 1;
|
var i = 1;
|
||||||
documents.ForEach(e => {
|
documents.ForEach(e =>
|
||||||
|
{
|
||||||
e.Nested.SomeDate = e.Nested.SomeDate.AddDays(i++);
|
e.Nested.SomeDate = e.Nested.SomeDate.AddDays(i++);
|
||||||
e.SomeContent = criteria;
|
e.SomeContent = criteria;
|
||||||
});
|
});
|
||||||
@@ -900,7 +906,8 @@ namespace CoreIntegrationTests.Infrastructure
|
|||||||
var criteria = $"{GetTestName()}.{DocumentTypeName}.{Guid.NewGuid()}";
|
var criteria = $"{GetTestName()}.{DocumentTypeName}.{Guid.NewGuid()}";
|
||||||
var documents = CreateTestDocuments(5);
|
var documents = CreateTestDocuments(5);
|
||||||
var i = 1;
|
var i = 1;
|
||||||
documents.ForEach(e => {
|
documents.ForEach(e =>
|
||||||
|
{
|
||||||
e.Nested.SomeDate = e.Nested.SomeDate.AddDays(i++);
|
e.Nested.SomeDate = e.Nested.SomeDate.AddDays(i++);
|
||||||
e.SomeContent = criteria;
|
e.SomeContent = criteria;
|
||||||
});
|
});
|
||||||
@@ -922,7 +929,8 @@ namespace CoreIntegrationTests.Infrastructure
|
|||||||
var criteria = $"{GetTestName()}.{DocumentTypeName}.{Guid.NewGuid()}";
|
var criteria = $"{GetTestName()}.{DocumentTypeName}.{Guid.NewGuid()}";
|
||||||
var documents = CreateTestDocuments(5);
|
var documents = CreateTestDocuments(5);
|
||||||
var i = 1;
|
var i = 1;
|
||||||
documents.ForEach(e => {
|
documents.ForEach(e =>
|
||||||
|
{
|
||||||
e.Nested.SomeDate = e.Nested.SomeDate.AddDays(i++);
|
e.Nested.SomeDate = e.Nested.SomeDate.AddDays(i++);
|
||||||
e.SomeContent = criteria;
|
e.SomeContent = criteria;
|
||||||
});
|
});
|
||||||
@@ -1056,6 +1064,7 @@ namespace CoreIntegrationTests.Infrastructure
|
|||||||
// Act
|
// Act
|
||||||
Expression<Func<T, object>> ex = x => x.SomeContent4;
|
Expression<Func<T, object>> ex = x => x.SomeContent4;
|
||||||
Expression<Func<T, object>> ex2 = x => x.SomeContent5;
|
Expression<Func<T, object>> ex2 = x => x.SomeContent5;
|
||||||
|
|
||||||
var result = await SUT.CreateCombinedTextIndexAsync<T, TKey>(new[] { ex, ex2 }, null, PartitionKey);
|
var result = await SUT.CreateCombinedTextIndexAsync<T, TKey>(new[] { ex, ex2 }, null, PartitionKey);
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
|
|||||||
@@ -305,7 +305,7 @@ namespace MongoDbGenericRepository
|
|||||||
public async Task DropIndexAsync<TDocument>(string indexName, string partitionKey = null)
|
public async Task DropIndexAsync<TDocument>(string indexName, string partitionKey = null)
|
||||||
where TDocument : IDocument<Guid>
|
where TDocument : IDocument<Guid>
|
||||||
{
|
{
|
||||||
await MongoDbIndexHandler.DropIndexAsync<TDocument, Guid>(partitionKey);
|
await MongoDbIndexHandler.DropIndexAsync<TDocument, Guid>(indexName, partitionKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
@@ -313,7 +313,7 @@ namespace MongoDbGenericRepository
|
|||||||
where TDocument : IDocument<TKey>
|
where TDocument : IDocument<TKey>
|
||||||
where TKey : IEquatable<TKey>
|
where TKey : IEquatable<TKey>
|
||||||
{
|
{
|
||||||
await MongoDbIndexHandler.DropIndexAsync<TDocument, TKey>(partitionKey);
|
await MongoDbIndexHandler.DropIndexAsync<TDocument, TKey>(indexName, partitionKey);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user