Exemplo n.º 1
0
        public void PqsqlDataReaderTest3()
        {
            mCmd.CommandText = "select datid,datname,pid,application_name,backend_start,query from pg_stat_activity";
            PqsqlDataReader reader = mCmd.ExecuteReader(CommandBehavior.CloseConnection);

            Assert.AreEqual(false, reader.IsClosed);
            Assert.AreEqual(-1, reader.RecordsAffected);

            int ordinal = reader.GetOrdinal("application_name");

            // application_name is the 4th column
            Assert.AreEqual(3, ordinal);

            reader.Close();

            Assert.AreEqual(ConnectionState.Closed, mConnection.State);
            Assert.AreEqual(true, reader.IsClosed);
        }