Skip to content

Commit 4dfae3e

Browse files
committed
Added failing index tests to show that indexes can be created without configure indexes being called.
1 parent a39c1f9 commit 4dfae3e

File tree

2 files changed

+548
-7
lines changed

2 files changed

+548
-7
lines changed

tests/Foundatio.Repositories.Elasticsearch.Tests/DailyRepositoryTests.cs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,15 @@ public async Task CanAddAsync()
7878
}
7979

8080
[Fact]
81-
public Task AddAsyncConcurrentUpdates()
81+
public async Task AddAsyncConcurrentUpdates()
8282
{
83-
return Parallel.ForEachAsync(Enumerable.Range(0, 50), async (i, _) =>
83+
for (int index = 0; index < 5; index++)
8484
{
85-
var history = await _fileAccessHistoryRepository.AddAsync(new FileAccessHistory { AccessedDateUtc = DateTime.UtcNow });
86-
Assert.NotNull(history?.Id);
87-
});
85+
await Parallel.ForEachAsync(Enumerable.Range(0, 10), async (_, _) =>
86+
{
87+
var history = await _fileAccessHistoryRepository.AddAsync(new FileAccessHistory { AccessedDateUtc = DateTime.UtcNow.AddDays(index) });
88+
Assert.NotNull(history?.Id);
89+
});
90+
}
8891
}
8992
}

0 commit comments

Comments
 (0)