Beispiel #1
0
        public void DataSetSource_get_column_works()
        {
            DataSet       ds    = GetDataSet();
            DataSetSource dss   = new DataSetSource(ds);
            int           table = dss.GetTables().First();

            object[] col0 = dss.GetColumn(table, 0);
            object[] col1 = dss.GetColumn(table, 1);
            object[] col2 = dss.GetColumn(table, 2);
            Assert.IsNotNull(col0);
            Assert.IsNotNull(col1);
            Assert.IsNull(col2);
            Assert.AreEqual(2, col0.Length);
            Assert.AreEqual(2, col1.Length);
            Assert.IsInstanceOfType(col0[0], typeof(int));
            Assert.IsInstanceOfType(col0[1], typeof(int));
            Assert.IsInstanceOfType(col1[0], typeof(string));
            Assert.AreEqual(0, col0[0]);
            Assert.AreEqual(1, col0[1]);
            Assert.AreEqual("testrow0", col1[0]);
            Assert.AreEqual(null, col1[1]);
        }
Beispiel #2
0
 public object[] GetColumn(int tableIndex, int fieldIndex)
 {
     return(_source.GetColumn(tableIndex, fieldIndex));
 }