FakeDbConnection FakeDbConnection Class

Definition

public class FakeDbConnection : DbConnection, IDbConnection, IDisposable
Public Class FakeDbConnection
    Inherits DbConnection
    Implements IDbConnection, IDisposable
Inheritance
System.ObjectSystem.Object
System.Data.Common.DbConnectionSystem.Data.Common.DbConnection
FakeDbConnectionFakeDbConnection
Implements
System.Data.IDbConnectionSystem.Data.IDbConnection System.IDisposableSystem.IDisposable

Constructors

FakeDbConnection(String, FakeCommandExecutor, ConnectionState) FakeDbConnection(String, FakeCommandExecutor, ConnectionState)

public FakeDbConnection(string connectionString, FakeCommandExecutor commandExecutor = null, ConnectionState state = ConnectionState.Closed)
Public Sub New(connectionString As String, commandExecutor As FakeCommandExecutor = Nothing, state As ConnectionState = ConnectionState.Closed)
Parameters
connectionString
System.String System.String
state
System.Data.ConnectionState System.Data.ConnectionState

Properties

ActiveTransaction ActiveTransaction

public FakeDbTransaction ActiveTransaction { get; set; }
Public Property ActiveTransaction As FakeDbTransaction

CloseCount CloseCount

public int CloseCount { get; }
Public ReadOnly Property CloseCount As Integer
Value
System.Int32 System.Int32

ConnectionString ConnectionString

public override string ConnectionString { get; set; }
Public Overrides Property ConnectionString As String
Value
System.String System.String
Overrides
System.Data.Common.DbConnection.ConnectionStringSystem.Data.Common.DbConnection.ConnectionString

DataSource DataSource

public override string DataSource { get; }
Public Overrides ReadOnly Property DataSource As String
Value
System.String System.String
Overrides
System.Data.Common.DbConnection.DataSourceSystem.Data.Common.DbConnection.DataSource

Database Database

public override string Database { get; }
Public Overrides ReadOnly Property Database As String
Value
System.String System.String
Overrides
System.Data.Common.DbConnection.DatabaseSystem.Data.Common.DbConnection.Database

DbCommands DbCommands

public IReadOnlyList<FakeDbCommand> DbCommands { get; }
Public ReadOnly Property DbCommands As IReadOnlyList(Of FakeDbCommand)
Value
System.Collections.Generic.IReadOnlyList<FakeDbCommand> System.Collections.Generic.IReadOnlyList(Of FakeDbCommand)

DbTransactions DbTransactions

public IReadOnlyList<FakeDbTransaction> DbTransactions { get; }
Public ReadOnly Property DbTransactions As IReadOnlyList(Of FakeDbTransaction)
Value
System.Collections.Generic.IReadOnlyList<FakeDbTransaction> System.Collections.Generic.IReadOnlyList(Of FakeDbTransaction)

DisposeCount DisposeCount

public int DisposeCount { get; }
Public ReadOnly Property DisposeCount As Integer
Value
System.Int32 System.Int32

OpenAsyncCount OpenAsyncCount

public int OpenAsyncCount { get; }
Public ReadOnly Property OpenAsyncCount As Integer
Value
System.Int32 System.Int32

OpenCount OpenCount

public int OpenCount { get; }
Public ReadOnly Property OpenCount As Integer
Value
System.Int32 System.Int32

ServerVersion ServerVersion

public override string ServerVersion { get; }
Public Overrides ReadOnly Property ServerVersion As String
Value
System.String System.String
Overrides
System.Data.Common.DbConnection.ServerVersionSystem.Data.Common.DbConnection.ServerVersion

State State

public override ConnectionState State { get; }
Public Overrides ReadOnly Property State As ConnectionState
Value
System.Data.ConnectionState System.Data.ConnectionState
Overrides
System.Data.Common.DbConnection.StateSystem.Data.Common.DbConnection.State

Methods

BeginDbTransaction(IsolationLevel) BeginDbTransaction(IsolationLevel)

protected override DbTransaction BeginDbTransaction(IsolationLevel isolationLevel)
Protected Overrides Function BeginDbTransaction(isolationLevel As IsolationLevel) As DbTransaction
Parameters
isolationLevel
System.Data.IsolationLevel System.Data.IsolationLevel
Returns
System.Data.Common.DbTransaction System.Data.Common.DbTransaction
Overrides
System.Data.Common.DbConnection.BeginDbTransaction(System.Data.IsolationLevel)System.Data.Common.DbConnection.BeginDbTransaction(System.Data.IsolationLevel)

BeginTransaction() BeginTransaction()

Inherited from System.Data.Common.DbConnection

BeginTransaction(IsolationLevel) BeginTransaction(IsolationLevel)

Inherited from System.Data.Common.DbConnection

ChangeDatabase(String) ChangeDatabase(String)

public override void ChangeDatabase(string databaseName)
Public Overrides Sub ChangeDatabase(databaseName As String)
Parameters
databaseName
System.String System.String
Overrides
System.Data.Common.DbConnection.ChangeDatabase(System.String)System.Data.Common.DbConnection.ChangeDatabase(System.String)

Close() Close()

public override void Close()
Public Overrides Sub Close
Overrides
System.Data.Common.DbConnection.Close()System.Data.Common.DbConnection.Close()

ConnectionTimeout ConnectionTimeout

Inherited from System.Data.Common.DbConnection

CreateCommand() CreateCommand()

Inherited from System.Data.Common.DbConnection

CreateDbCommand() CreateDbCommand()

protected override DbCommand CreateDbCommand()
Protected Overrides Function CreateDbCommand As DbCommand
Returns
System.Data.Common.DbCommand System.Data.Common.DbCommand
Overrides
System.Data.Common.DbConnection.CreateDbCommand()System.Data.Common.DbConnection.CreateDbCommand()

DbProviderFactory DbProviderFactory

Inherited from System.Data.Common.DbConnection

Dispose(Boolean) Dispose(Boolean)

protected override void Dispose(bool disposing)
Protected Overrides Sub Dispose(disposing As Boolean)
Parameters
disposing
System.Boolean System.Boolean

EnlistTransaction(Transaction) EnlistTransaction(Transaction)

Inherited from System.Data.Common.DbConnection

GetSchema() GetSchema()

Inherited from System.Data.Common.DbConnection

GetSchema(String) GetSchema(String)

Inherited from System.Data.Common.DbConnection

GetSchema(String, String[]) GetSchema(String, String())

Inherited from System.Data.Common.DbConnection

IDbConnection.BeginTransaction() System.Data.IDbConnection.BeginTransaction()

Inherited from System.Data.Common.DbConnection

IDbConnection.BeginTransaction(IsolationLevel) System.Data.IDbConnection.BeginTransaction(IsolationLevel)

Inherited from System.Data.Common.DbConnection

IDbConnection.CreateCommand() System.Data.IDbConnection.CreateCommand()

Inherited from System.Data.Common.DbConnection

OnStateChange(StateChangeEventArgs) OnStateChange(StateChangeEventArgs)

Inherited from System.Data.Common.DbConnection

Open() Open()

public override void Open()
Public Overrides Sub Open
Overrides
System.Data.Common.DbConnection.Open()System.Data.Common.DbConnection.Open()

OpenAsync() OpenAsync()

Inherited from System.Data.Common.DbConnection

OpenAsync(CancellationToken) OpenAsync(CancellationToken)

public override Task OpenAsync(CancellationToken cancellationToken)
Public Overrides Function OpenAsync(cancellationToken As CancellationToken) As Task
Parameters
cancellationToken
System.Threading.CancellationToken System.Threading.CancellationToken
Returns
System.Threading.Tasks.Task System.Threading.Tasks.Task
Overrides
System.Data.Common.DbConnection.OpenAsync(System.Threading.CancellationToken)System.Data.Common.DbConnection.OpenAsync(System.Threading.CancellationToken)

SetState(ConnectionState) SetState(ConnectionState)

public void SetState(ConnectionState state)
Public Sub SetState(state As ConnectionState)
Parameters
state
System.Data.ConnectionState System.Data.ConnectionState

StateChange StateChange

Inherited from System.Data.Common.DbConnection