Пример #1
0
        public void DataSetSource_get_cell_works()
        {
            DataSet       ds    = GetDataSet();
            DataSetSource dss   = new DataSetSource(ds);
            int           table = dss.GetTables().First();

            object c00 = dss.GetCell(table, 0, 0);
            object c01 = dss.GetCell(table, 0, 1);
            object c10 = dss.GetCell(table, 1, 0);
            object c11 = dss.GetCell(table, 1, 1);
            object c22 = dss.GetCell(table, 2, 2);

            Assert.IsNotNull(c00);
            Assert.IsNotNull(c01);
            Assert.IsNotNull(c10);
            Assert.IsNull(c11);
            Assert.IsNull(c22);
            Assert.IsInstanceOfType(c00, typeof(int));
            Assert.IsInstanceOfType(c01, typeof(string));
            Assert.IsInstanceOfType(c10, typeof(int));
            Assert.AreEqual(0, c00);
            Assert.AreEqual("testrow0", c01);
            Assert.AreEqual(1, c10);
        }
Пример #2
0
 public object GetCell(int tableIndex, int rowIndex, int fieldIndex)
 {
     return(_source.GetCell(tableIndex, rowIndex, fieldIndex));
 }