示例#1
0
        public void TestRowValueAggregatesOrder_bug45145()
        {
            InternalSheet sheet = InternalSheet.CreateSheet();

            RowRecord rr = new RowRecord(5);

            sheet.AddRow(rr);

            CellValueRecordInterface cvr = new BlankRecord();

            cvr.Column = 0;
            cvr.Row    = (5);
            sheet.AddValueRecord(5, cvr);


            int dbCellRecordPos = GetDbCellRecordPos(sheet);

            if (dbCellRecordPos == 252)
            {
                // The overt symptom of the bug
                // DBCELL record pos is1 calculated wrong if VRA comes before RRA
                throw new AssertionException("Identified  bug 45145");
            }

            Assert.AreEqual(242, dbCellRecordPos);
        }
示例#2
0
        public void TestSheetDimensions()
        {
            InternalSheet    sheet      = InternalSheet.CreateSheet();
            DimensionsRecord dimensions = (DimensionsRecord)sheet.FindFirstRecordBySid(DimensionsRecord.sid);

            Assert.AreEqual(0, dimensions.FirstCol);
            Assert.AreEqual(0, dimensions.FirstRow);
            Assert.AreEqual(1, dimensions.LastCol);  // plus pne
            Assert.AreEqual(1, dimensions.LastRow);  // plus pne

            RowRecord rr = new RowRecord(0);

            sheet.AddRow(rr);

            Assert.AreEqual(0, dimensions.FirstCol);
            Assert.AreEqual(0, dimensions.FirstRow);
            Assert.AreEqual(1, dimensions.LastCol);
            Assert.AreEqual(1, dimensions.LastRow);

            CellValueRecordInterface cvr;

            cvr        = new BlankRecord();
            cvr.Column = ((short)0);
            cvr.Row    = (0);
            sheet.AddValueRecord(0, cvr);

            Assert.AreEqual(0, dimensions.FirstCol);
            Assert.AreEqual(0, dimensions.FirstRow);
            Assert.AreEqual(1, dimensions.LastCol);
            Assert.AreEqual(1, dimensions.LastRow);

            cvr        = new BlankRecord();
            cvr.Column = ((short)1);
            cvr.Row    = (0);
            sheet.AddValueRecord(0, cvr);

            Assert.AreEqual(0, dimensions.FirstCol);
            Assert.AreEqual(0, dimensions.FirstRow);
            Assert.AreEqual(2, dimensions.LastCol);   //YK:  failed until Bugzilla 53414 was fixed
            Assert.AreEqual(1, dimensions.LastRow);
        }