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"]); }
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"]); }
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"]); }
public void InitializeWithAnInvalidReaderNameAndThrowAnException() { ReaderToColumnMap map = new ReaderToColumnMap("NotARealColumn", "AdmissionDate"); map.Initialize(_destinationTable, _reader); }
public void InitializeWithAnInvalidColumnNameAndThrowAnException() { ReaderToColumnMap map = new ReaderToColumnMap("StatehoodDate", "NotARealColumn"); map.Initialize(_destinationTable, _reader); }
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"]); }