Skip to content

Commit

Permalink
small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
johnml1135 committed Dec 4, 2024
1 parent a6650e5 commit 5b1d67d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/DataAccess/src/SIL.DataAccess/MongoRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ public async Task<int> UpdateAllAsync<TFilter>(
{
ArrayFilters = [new JsonArrayFilterDefinition<TFilter>(jsonArrayFilterDefinition)]
};
return await UpdateAllAsync(filter, update, updateOptions, cancellationToken);
return await UpdateAllAsync(filter, update, updateOptions, cancellationToken).ConfigureAwait(false);
}

public async Task<int> UpdateAllAsync(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,16 @@ private class TestEnvironment
public TestEnvironment()
{
Corpora = new MemoryRepository<Corpus>();
DataAccessContext = Substitute.For<IDataAccessContext>();
DataAccessContext
.WithTransactionAsync(Arg.Any<Func<CancellationToken, Task<Corpus>>>(), Arg.Any<CancellationToken>())
.Returns(x =>
{
return ((Func<CancellationToken, Task<Corpus>>)x[0])((CancellationToken)x[1]);
});
Service = new CorpusService(
Corpora,
Substitute.For<IDataAccessContext>(),
DataAccessContext,
Substitute.For<IDataFileService>(),
Substitute.For<IScopedMediator>()
);
Expand All @@ -58,5 +65,7 @@ public TestEnvironment()
public MemoryRepository<Corpus> Corpora { get; }

public CorpusService Service { get; }

public IDataAccessContext DataAccessContext { get; }
}
}

0 comments on commit 5b1d67d

Please sign in to comment.