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

            int[] fields = dss.GetFields(table).ToArray();
            Assert.AreEqual(2, fields.Length);
            Assert.AreEqual("column0", dss.GetFieldName(table, fields[0]));
            Assert.AreEqual("column1", dss.GetFieldName(table, fields[1]));
            Assert.AreEqual(fields[0], dss.GetFieldIndex(table, "column0"));
            Assert.AreEqual(fields[1], dss.GetFieldIndex(table, "column1"));
        }
예제 #2
0
 public IEnumerable <int> GetFields(int tableIndex)
 {
     return(_source.GetFields(tableIndex));
 }