public void Dispose_DisposesTheConnection_IfOwned() { using (var sqlConnection = ConnectionUtils.CreateConnection()) { var connection = new FirebirdConnection(sqlConnection, _providers, _options); connection.Dispose(); Assert.Equal(ConnectionState.Closed, sqlConnection.State); } }
public void Dispose_DoesNotDisposeTheConnection_IfNotOwned() { using (var sqlConnection = ConnectionUtils.CreateConnection()) { var connection = new FirebirdConnection(sqlConnection, _providers, ownsConnection: false, options: _options); connection.Dispose(); Assert.Equal(ConnectionState.Open, sqlConnection.State); } }