Skip to content

Commit 2f81c0e

Browse files
authored
Fix null reference exception causing failed tests (#1181)
1 parent a28da50 commit 2f81c0e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tests/MongoDB.Driver.Core.Tests/Jira/CSharp3302Tests.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ private IConnectionPoolFactory CreateAndSetupConnectionPoolFactory(params (Serve
197197

198198
void SetupConnection(Mock<IConnectionHandle> mockConnectionHandle, ServerId serverId)
199199
{
200+
mockConnectionHandle.SetupGet(f => f.Settings).Returns(() => new ConnectionSettings());
200201
mockConnectionHandle.SetupGet(c => c.ConnectionId).Returns(new ConnectionId(serverId));
201202
}
202203

@@ -304,6 +305,7 @@ private void SetupServerMonitorConnection(
304305

305306
mockConnection.SetupGet(c => c.ConnectionId).Returns(connectionId);
306307
mockConnection.SetupGet(c => c.EndPoint).Returns(serverId.EndPoint);
308+
mockConnection.SetupGet(f => f.Settings).Returns(() => new ConnectionSettings());
307309

308310
mockConnection
309311
.SetupGet(c => c.Description)

0 commit comments

Comments
 (0)