Esempio n. 1
0
        public void PagingWithColumnFilterWorks()
        {
            CreateTable(database);

            var reader   = new DataStoreReader(database);
            var provider = new PagedDataProvider(reader, "Current", "Report",
                                                 null,
                                                 "Col2",
                                                 null,
                                                 2);

            Assert.AreEqual(2, provider.ColumnCount);
            Assert.AreEqual("SimulationName", provider.GetCellContents(0, 0));
            Assert.AreEqual("Col2", provider.GetCellContents(1, 0));
            Assert.AreEqual(8, provider.RowCount);
            Assert.AreEqual(1, provider.NumHeadingRows);
            Assert.AreEqual("8", provider.GetCellContents(1, 1));
            Assert.AreEqual("9", provider.GetCellContents(1, 2));
            Assert.AreEqual("10", provider.GetCellContents(1, 3));
            Assert.AreEqual("11", provider.GetCellContents(1, 4));
            Assert.AreEqual("12", provider.GetCellContents(1, 5));
            Assert.AreEqual("13", provider.GetCellContents(1, 6));
            Assert.AreEqual("14", provider.GetCellContents(1, 7));
        }
Esempio n. 2
0
        public void PagingWithSimulationColumnandRowFilterWorks()
        {
            CreateTable(database);

            var reader   = new DataStoreReader(database);
            var provider = new PagedDataProvider(reader, "Current", "Report",
                                                 new string[] { "Sim1" },
                                                 "Col1,Col2",
                                                 "Col1 > 2",
                                                 2);

            Assert.AreEqual(3, provider.ColumnCount);
            Assert.AreEqual("SimulationName", provider.GetCellContents(0, 0));
            Assert.AreEqual("Col1", provider.GetCellContents(1, 0));
            Assert.AreEqual("Col2", provider.GetCellContents(2, 0));
            Assert.AreEqual(3, provider.RowCount);
            Assert.AreEqual(2, provider.NumHeadingRows);
            Assert.AreEqual("g", provider.GetCellContents(1, 1));
            Assert.IsNull(provider.GetCellContents(2, 1));
            Assert.AreEqual("10", provider.GetCellContents(2, 2));
        }
Esempio n. 3
0
        public void PagingWorks()
        {
            CreateTable(database);

            var reader   = new DataStoreReader(database);
            var provider = new PagedDataProvider(reader, "Current", "Report",
                                                 null,
                                                 null,
                                                 null,
                                                 2);

            Assert.AreEqual(3, provider.ColumnCount);
            Assert.AreEqual("SimulationName", provider.GetCellContents(0, 0));
            Assert.AreEqual("Col1", provider.GetCellContents(1, 0));
            Assert.AreEqual("Col2", provider.GetCellContents(2, 0));
            Assert.AreEqual(9, provider.RowCount);
            Assert.AreEqual(2, provider.NumHeadingRows);
            Assert.AreEqual("g", provider.GetCellContents(1, 1));
            Assert.AreEqual("1", provider.GetCellContents(1, 2));
            Assert.AreEqual("2", provider.GetCellContents(1, 3));
            Assert.AreEqual("3", provider.GetCellContents(1, 4));
            Assert.AreEqual("4", provider.GetCellContents(1, 5));
            Assert.AreEqual("5", provider.GetCellContents(1, 6));
            Assert.AreEqual("6", provider.GetCellContents(1, 7));
            Assert.AreEqual("7", provider.GetCellContents(1, 8));
        }