Esempio n. 1
0
        public void GetItemProperties()
        {
            PagedDataSource ds    = new PagedDataSource();
            DataTable       table = new DataTable();

            table.Columns.Add(new DataColumn("one", typeof(string)));
            table.Columns.Add(new DataColumn("two", typeof(string)));
            table.Columns.Add(new DataColumn("three", typeof(string)));

            ds.DataSource = new DataView(table);
            PropertyDescriptorCollection props = ds.GetItemProperties(null);

            Assert.AreEqual(props.Count, 3, "A1");
            Assert.AreEqual(props [0].Name, "one", "A2");
            Assert.AreEqual(props [1].Name, "two", "A3");
            Assert.AreEqual(props [2].Name, "three", "A4");

            ds.DataSource = new ArrayList();
            props         = ds.GetItemProperties(null);
            Assert.AreEqual(props, null, "A5");
        }