File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
src/Microsoft.Data.SqlClient/tests/UnitTests/ConnectionPool Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -60,10 +60,11 @@ public void GetTransactedObject_WithNonExistentTransaction_ReturnsNull()
6060 {
6161 // Arrange
6262 var transactedPool = new TransactedConnectionPool ( new MockDbConnectionPool ( ) ) ;
63- using var transaction = new TransactionScope ( ) ;
63+ using var transactionScope = new TransactionScope ( ) ;
64+ var transaction = Transaction . Current ! ;
6465
6566 // Act
66- var result = transactedPool . GetTransactedObject ( Transaction . Current ! ) ;
67+ var result = transactedPool . GetTransactedObject ( transaction ) ;
6768
6869 // Assert
6970 Assert . Null ( result ) ;
@@ -669,7 +670,7 @@ internal class MockDbConnectionPool : IDbConnectionPool
669670 public DbConnectionPoolState State => throw new NotImplementedException ( ) ;
670671 public bool UseLoadBalancing => throw new NotImplementedException ( ) ;
671672
672- public List < DbConnectionInternal > ReturnedConnections { get ; } = new ( ) ;
673+ public ConcurrentBag < DbConnectionInternal > ReturnedConnections { get ; } = new ( ) ;
673674
674675 public void Clear ( ) => throw new NotImplementedException ( ) ;
675676
You can’t perform that action at this time.
0 commit comments