// Constructors /// <summary> /// Initializes a new instance of the <see cref="T:MockTransaction"/> class. /// </summary> /// <param name="connection">The connection for this instance.</param> /// <param name="isolationLevel">The isolation level of the transaction.</param> internal MockTransaction(MockConnection connection, IsolationLevel isolationLevel) : base() { Debug.Assert(connection != null); this._connection = connection; this._isolationLevel = isolationLevel; }
public void DbConnectionExtensions_Integration_CreateCommand1_Optimal() { using (IDbConnection connection = new MockConnection()) { CommandType commandType = CommandType.Text; String commandText = "SELECT * FROM MyTable"; using (IDbCommand actual = DbConnectionExtensions.CreateCommand(connection, commandType, commandText)) { Assert.IsNotNull(actual); } } }
public void DbConnectionExtensions_Unit_CreateCommand2_ConnectionIsNull() { IDbConnection connection = null; CommandType commandType = CommandType.Text; String commandText = "SELECT * FROM MyTable"; using (IDbTransaction transaction = new MockConnection().BeginTransaction()) { DbConnectionExtensions.CreateCommand(connection, commandType, commandText, transaction); } }
/// <summary> /// Initializes a new instance of the <see cref="T:MockCommand"/> class. /// </summary> /// <param name="connection">The connection for this instance.</param> public MockCommand(MockConnection connection) : base() { this._connection = connection; }