コード例 #1
0
        public void TransferDate()
        {
            ReaderToColumnMap map = new ReaderToColumnMap("StatehoodDate", "AdmissionDate");
            map.Initialize(_destinationTable, _reader);

            // Move to first row
            _reader.Read();

            map.Fill(_row, _reader);

            Assert.AreEqual(_texasDate, (DateTime)_row["AdmissionDate"]);
        }
コード例 #2
0
        public void TransferADBNull()
        {
            ReaderToColumnMap map = new ReaderToColumnMap("StatehoodDate", "AdmissionDate");
            map.Initialize(_destinationTable, _reader);

            // Move to second row
            _reader.Read();
            _reader.Read();

            map.Fill(_row, _reader);

            Assert.AreEqual(DBNull.Value, _row["AdmissionDate"]);
        }
コード例 #3
0
        public void TransferLong()
        {
            ReaderToColumnMap map = new ReaderToColumnMap("Population", "Residents");
            map.Initialize(_destinationTable, _reader);

            // Move to first row
            _reader.Read();

            map.Fill(_row, _reader);

            Assert.AreEqual(5, (long)_row["Residents"]);
        }
コード例 #4
0
 public void InitializeWithAnInvalidReaderNameAndThrowAnException()
 {
     ReaderToColumnMap map = new ReaderToColumnMap("NotARealColumn", "AdmissionDate");
     map.Initialize(_destinationTable, _reader);
 }
コード例 #5
0
 public void InitializeWithAnInvalidColumnNameAndThrowAnException()
 {
     ReaderToColumnMap map = new ReaderToColumnMap("StatehoodDate", "NotARealColumn");
     map.Initialize(_destinationTable, _reader);
 }
コード例 #6
0
        public void TransferString()
        {
            ReaderToColumnMap map = new ReaderToColumnMap("State", "StateName");
            map.Initialize(_destinationTable, _reader);

            // Move to first row
            _reader.Read();

            map.Fill(_row, _reader);

            Assert.AreEqual("Texas", (string)_row["StateName"]);
        }