示例#1
0
        public void ConnectionOpened()
        {
            var connectionID = Guid.NewGuid();

            _innerPersistenceListener1.Expect(mock => mock.ConnectionOpened(connectionID));
            _innerPersistenceListener2.Expect(mock => mock.ConnectionOpened(connectionID));
            _mockRepository.ReplayAll();

            _extension.ConnectionOpened(connectionID);

            _mockRepository.VerifyAll();
        }
示例#2
0
        public void Dispose()
        {
            using (_mockRepository.Ordered())
            {
                _extensionMock.Expect(
                    mock =>
                    mock.QueryCompleted(
                        Arg <Guid> .Matches(p => p == _connectionID),
                        Arg <Guid> .Matches(p => p == _queryID),
                        Arg <TimeSpan> .Matches(p => p.Milliseconds > 0),
                        Arg <int> .Matches(p => p == 0)));
                _innerDataReader.Expect(mock => mock.Dispose());
            }
            _mockRepository.ReplayAll();

            _dataReader.Dispose();
            _mockRepository.VerifyAll();
        }
示例#3
0
        public void Open()
        {
            using (_mockRepository.Ordered())
            {
                _innerConnectionMock.Expect(mock => mock.Open());
                _extensionMock.Expect(mock => mock.ConnectionOpened(((TracingDbConnection)_connection).ConnectionID));
            }
            _mockRepository.ReplayAll();

            _connection.Open();

            _mockRepository.VerifyAll();
        }
        public void Dispose()
        {
            using (_mockRepository.Ordered())
            {
                _innerTransactionMock.Expect(mock => mock.Dispose());
                _extensionMock.Expect(mock => mock.TransactionDisposed(_connectionID));
            }
            _mockRepository.ReplayAll();

            _transaction.Dispose();
            _mockRepository.VerifyAll();
        }