Inheritance: System.Data.Common.DbCommand
コード例 #1
0
        public void SetUp()
        {
            _commandFactory = Substitute.For <IDbCommandFactory>();
            _logger         = Substitute.For <ISqlCommandLogger>();
            _executor       = new DbCommandExecutor(_logger, _commandFactory);

            _command    = new TestDbCommand();
            _connection = new TestDbConnection();

            _command.StubScalarResult = 1;
            _command.StubDataReader   = new TestDbDataReader()
            {
                ResultSet = new ResultSet(new[] { new Row(new[] { new ColumnValue("Id", 1), }), })
            };
            _commandFactory.CreateConnection().Returns(_connection);
        }
コード例 #2
0
        public void SetUp()
        {
            _commandFactory = Substitute.For<IDbCommandFactory>();
            _logger = Substitute.For<ISqlCommandLogger>();
            _executor = new DbCommandExecutor(_logger, _commandFactory);

            _command = new TestDbCommand();
            _connection = new TestDbConnection();

            _command.StubScalarResult = 1;
            _command.StubDataReader = new TestDbDataReader() { ResultSet = new ResultSet(new[] { new Row(new[] { new ColumnValue("Id", 1), }), }) };
            _commandFactory.CreateConnection().Returns(_connection);
        }