Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions tests/MongoDB.Driver.Tests/IMongoClientExtensionsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
*/

using System.Threading;
using System.Threading.Tasks;
using MongoDB.Bson;
using MongoDB.TestHelpers.XunitExtensions;
using Moq;
Expand All @@ -25,7 +26,7 @@ public class IMongoClientExtensionsTests
{
[Theory]
[ParameterAttributeData]
public void Watch_should_call_client_with_expected_arguments(
public async Task Watch_should_call_client_with_expected_arguments(
[Values(false, true)] bool usingSession,
[Values(false, true)] bool async)
{
Expand All @@ -40,7 +41,7 @@ public void Watch_should_call_client_with_expected_arguments(
{
if (async)
{
client.WatchAsync(session, options, cancellationToken);
await client.WatchAsync(session, options, cancellationToken);
mockClient.Verify(m => m.WatchAsync(session, It.IsAny<EmptyPipelineDefinition<ChangeStreamDocument<BsonDocument>>>(), options, cancellationToken), Times.Once);
}
else
Expand All @@ -53,7 +54,7 @@ public void Watch_should_call_client_with_expected_arguments(
{
if (async)
{
client.WatchAsync(options, cancellationToken);
await client.WatchAsync(options, cancellationToken);
mockClient.Verify(m => m.WatchAsync(It.IsAny<EmptyPipelineDefinition<ChangeStreamDocument<BsonDocument>>>(), options, cancellationToken), Times.Once);
}
else
Expand Down
7 changes: 4 additions & 3 deletions tests/MongoDB.Driver.Tests/IMongoDatabaseExtensionsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
*/

using System.Threading;
using System.Threading.Tasks;
using MongoDB.Bson;
using MongoDB.TestHelpers.XunitExtensions;
using Moq;
Expand All @@ -25,7 +26,7 @@ public class IMongoDatabaseExtensionsTests
{
[Theory]
[ParameterAttributeData]
public void Watch_should_call_client_with_expected_arguments(
public async Task Watch_should_call_client_with_expected_arguments(
[Values(false, true)] bool usingSession,
[Values(false, true)] bool async)
{
Expand All @@ -40,7 +41,7 @@ public void Watch_should_call_client_with_expected_arguments(
{
if (async)
{
database.WatchAsync(session, options, cancellationToken);
await database.WatchAsync(session, options, cancellationToken);
mockDatabase.Verify(m => m.WatchAsync(session, It.IsAny<EmptyPipelineDefinition<ChangeStreamDocument<BsonDocument>>>(), options, cancellationToken), Times.Once);
}
else
Expand All @@ -53,7 +54,7 @@ public void Watch_should_call_client_with_expected_arguments(
{
if (async)
{
database.WatchAsync(options, cancellationToken);
await database.WatchAsync(options, cancellationToken);
mockDatabase.Verify(m => m.WatchAsync(It.IsAny<EmptyPipelineDefinition<ChangeStreamDocument<BsonDocument>>>(), options, cancellationToken), Times.Once);
}
else
Expand Down
Loading