Exemplo n.º 1
0
        // 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;
        }
Exemplo n.º 2
0
        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);
                }
            }
        }
Exemplo n.º 3
0
        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);
            }
        }
Exemplo n.º 4
0
 /// <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;
 }