@@ -195,11 +195,10 @@ public void TestCopyRange()
195195
196196 ws . Cell ( 11 , 9 ) . Value = DateTime . Now ;
197197 ws . Cell ( 11 , 9 ) . DataType = XLDataType . DateTime ;
198- //ws.Cell(11, 9).DataType = XLCellValues.DateTime;
199198
200199 IXLRange newRange = ExcelHelper . CopyRange ( range , ws . Cell ( 10 , 8 ) ) ;
201200
202- Assert . AreEqual ( 4 , ws . CellsUsed ( ) . Count ( ) ) ;
201+ Assert . AreEqual ( 4 , ws . CellsUsed ( XLCellsUsedOptions . Contents ) . Count ( ) ) ;
203202 Assert . AreEqual ( range . FirstCell ( ) , ws . Cell ( 6 , 5 ) ) ;
204203 Assert . AreEqual ( range . LastCell ( ) , ws . Cell ( 9 , 7 ) ) ;
205204 Assert . AreEqual ( "RangeStart" , range . FirstCell ( ) . Value . ToString ( ) ) ;
@@ -213,12 +212,11 @@ public void TestCopyRange()
213212 Assert . AreEqual ( XLBorderStyleValues . Thin , newRange . FirstCell ( ) . Style . Border . TopBorder ) ;
214213 Assert . AreEqual ( XLBorderStyleValues . Thin , newRange . LastCell ( ) . Style . Border . BottomBorder ) ;
215214 Assert . AreEqual ( XLDataType . Text , ws . Cell ( 11 , 9 ) . DataType ) ;
216- //Assert.AreEqual(XLCellValues.Text, ws.Cell(11, 9).DataType);
217215
218216 range . Clear ( ) ;
219217 IXLRange newRange2 = ExcelHelper . CopyRange ( newRange , ws . Cell ( 11 , 8 ) ) ;
220218
221- Assert . AreEqual ( 3 , ws . CellsUsed ( ) . Count ( ) ) ;
219+ Assert . AreEqual ( 3 , ws . CellsUsed ( XLCellsUsedOptions . Contents ) . Count ( ) ) ;
222220 Assert . AreEqual ( newRange . FirstCell ( ) , ws . Cell ( 10 , 8 ) ) ;
223221 Assert . AreEqual ( newRange . LastCell ( ) , ws . Cell ( 13 , 10 ) ) ;
224222 Assert . AreEqual ( "RangeStart" , newRange . FirstCell ( ) . Value . ToString ( ) ) ;
@@ -257,7 +255,7 @@ public void TestCopyNamedRange()
257255 IXLRange newRange = copiedNamedRange . Ranges . ElementAt ( 0 ) ;
258256
259257 Assert . AreEqual ( 1 , copiedNamedRange . Ranges . Count ) ;
260- Assert . AreEqual ( 4 , ws . CellsUsed ( ) . Count ( ) ) ;
258+ Assert . AreEqual ( 4 , ws . CellsUsed ( XLCellsUsedOptions . Contents ) . Count ( ) ) ;
261259 Assert . AreEqual ( range . FirstCell ( ) , ws . Cell ( 6 , 5 ) ) ;
262260 Assert . AreEqual ( range . LastCell ( ) , ws . Cell ( 9 , 7 ) ) ;
263261 Assert . AreEqual ( "RangeStart" , range . FirstCell ( ) . Value . ToString ( ) ) ;
@@ -278,7 +276,7 @@ public void TestCopyNamedRange()
278276 IXLRange newRange2 = copiedNamedRange2 . Ranges . ElementAt ( 0 ) ;
279277
280278 Assert . AreEqual ( 1 , copiedNamedRange2 . Ranges . Count ) ;
281- Assert . AreEqual ( 3 , ws . CellsUsed ( ) . Count ( ) ) ;
279+ Assert . AreEqual ( 3 , ws . CellsUsed ( XLCellsUsedOptions . Contents ) . Count ( ) ) ;
282280 Assert . AreEqual ( newRange . FirstCell ( ) , ws . Cell ( 10 , 8 ) ) ;
283281 Assert . AreEqual ( newRange . LastCell ( ) , ws . Cell ( 13 , 10 ) ) ;
284282 Assert . AreEqual ( "RangeStart" , newRange . FirstCell ( ) . Value . ToString ( ) ) ;
@@ -318,7 +316,7 @@ public void TestAllocateSpaceForNextRange()
318316 IXLCell leftCell1 = ws . Cells ( ) . Single ( c => c . Value . ToString ( ) == "LeftCell_1" ) ;
319317 IXLCell leftCell2 = ws . Cells ( ) . Single ( c => c . Value . ToString ( ) == "LeftCell_2" ) ;
320318
321- Assert . AreEqual ( 10 , ws . CellsUsed ( ) . Count ( ) ) ;
319+ Assert . AreEqual ( 10 , ws . CellsUsed ( XLCellsUsedOptions . Contents ) . Count ( ) ) ;
322320 Assert . AreEqual ( rangeStartCell , ws . Cell ( 10 , 5 ) ) ;
323321 Assert . AreEqual ( rangeEndCell , ws . Cell ( 13 , 7 ) ) ;
324322 Assert . AreEqual ( belowCell1 , ws . Cell ( 14 , 6 ) ) ;
@@ -349,7 +347,7 @@ public void TestAllocateSpaceForNextRange()
349347 leftCell1 = ws . Cells ( ) . Single ( c => c . Value . ToString ( ) == "LeftCell_1" ) ;
350348 leftCell2 = ws . Cells ( ) . Single ( c => c . Value . ToString ( ) == "LeftCell_2" ) ;
351349
352- Assert . AreEqual ( 10 , ws . CellsUsed ( ) . Count ( ) ) ;
350+ Assert . AreEqual ( 10 , ws . CellsUsed ( XLCellsUsedOptions . Contents ) . Count ( ) ) ;
353351 Assert . AreEqual ( rangeStartCell , ws . Cell ( 6 , 5 ) ) ;
354352 Assert . AreEqual ( rangeEndCell , ws . Cell ( 9 , 7 ) ) ;
355353 Assert . AreEqual ( belowCell1 , ws . Cell ( 14 , 6 ) ) ;
@@ -380,7 +378,7 @@ public void TestAllocateSpaceForNextRange()
380378 leftCell1 = ws . Cells ( ) . Single ( c => c . Value . ToString ( ) == "LeftCell_1" ) ;
381379 leftCell2 = ws . Cells ( ) . Single ( c => c . Value . ToString ( ) == "LeftCell_2" ) ;
382380
383- Assert . AreEqual ( 10 , ws . CellsUsed ( ) . Count ( ) ) ;
381+ Assert . AreEqual ( 10 , ws . CellsUsed ( XLCellsUsedOptions . Contents ) . Count ( ) ) ;
384382 Assert . AreEqual ( rangeStartCell , ws . Cell ( 10 , 5 ) ) ;
385383 Assert . AreEqual ( rangeEndCell , ws . Cell ( 13 , 7 ) ) ;
386384 Assert . AreEqual ( belowCell1 , ws . Cell ( 14 , 6 ) ) ;
@@ -411,7 +409,7 @@ public void TestAllocateSpaceForNextRange()
411409 leftCell1 = ws . Cells ( ) . Single ( c => c . Value . ToString ( ) == "LeftCell_1" ) ;
412410 leftCell2 = ws . Cells ( ) . Single ( c => c . Value . ToString ( ) == "LeftCell_2" ) ;
413411
414- Assert . AreEqual ( 10 , ws . CellsUsed ( ) . Count ( ) ) ;
412+ Assert . AreEqual ( 10 , ws . CellsUsed ( XLCellsUsedOptions . Contents ) . Count ( ) ) ;
415413 Assert . AreEqual ( rangeStartCell , ws . Cell ( 6 , 5 ) ) ;
416414 Assert . AreEqual ( rangeEndCell , ws . Cell ( 9 , 7 ) ) ;
417415 Assert . AreEqual ( belowCell1 , ws . Cell ( 14 , 6 ) ) ;
@@ -442,7 +440,7 @@ public void TestAllocateSpaceForNextRange()
442440 leftCell1 = ws . Cells ( ) . Single ( c => c . Value . ToString ( ) == "LeftCell_1" ) ;
443441 leftCell2 = ws . Cells ( ) . Single ( c => c . Value . ToString ( ) == "LeftCell_2" ) ;
444442
445- Assert . AreEqual ( 10 , ws . CellsUsed ( ) . Count ( ) ) ;
443+ Assert . AreEqual ( 10 , ws . CellsUsed ( XLCellsUsedOptions . Contents ) . Count ( ) ) ;
446444 Assert . AreEqual ( rangeStartCell , ws . Cell ( 6 , 8 ) ) ;
447445 Assert . AreEqual ( rangeEndCell , ws . Cell ( 9 , 10 ) ) ;
448446 Assert . AreEqual ( belowCell1 , ws . Cell ( 10 , 6 ) ) ;
@@ -473,7 +471,7 @@ public void TestAllocateSpaceForNextRange()
473471 leftCell1 = ws . Cells ( ) . Single ( c => c . Value . ToString ( ) == "LeftCell_1" ) ;
474472 leftCell2 = ws . Cells ( ) . Single ( c => c . Value . ToString ( ) == "LeftCell_2" ) ;
475473
476- Assert . AreEqual ( 10 , ws . CellsUsed ( ) . Count ( ) ) ;
474+ Assert . AreEqual ( 10 , ws . CellsUsed ( XLCellsUsedOptions . Contents ) . Count ( ) ) ;
477475 Assert . AreEqual ( rangeStartCell , ws . Cell ( 6 , 5 ) ) ;
478476 Assert . AreEqual ( rangeEndCell , ws . Cell ( 9 , 7 ) ) ;
479477 Assert . AreEqual ( belowCell1 , ws . Cell ( 10 , 6 ) ) ;
@@ -504,7 +502,7 @@ public void TestAllocateSpaceForNextRange()
504502 leftCell1 = ws . Cells ( ) . Single ( c => c . Value . ToString ( ) == "LeftCell_1" ) ;
505503 leftCell2 = ws . Cells ( ) . Single ( c => c . Value . ToString ( ) == "LeftCell_2" ) ;
506504
507- Assert . AreEqual ( 10 , ws . CellsUsed ( ) . Count ( ) ) ;
505+ Assert . AreEqual ( 10 , ws . CellsUsed ( XLCellsUsedOptions . Contents ) . Count ( ) ) ;
508506 Assert . AreEqual ( rangeStartCell , ws . Cell ( 6 , 8 ) ) ;
509507 Assert . AreEqual ( rangeEndCell , ws . Cell ( 9 , 10 ) ) ;
510508 Assert . AreEqual ( belowCell1 , ws . Cell ( 10 , 9 ) ) ;
@@ -535,7 +533,7 @@ public void TestAllocateSpaceForNextRange()
535533 leftCell1 = ws . Cells ( ) . Single ( c => c . Value . ToString ( ) == "LeftCell_1" ) ;
536534 leftCell2 = ws . Cells ( ) . Single ( c => c . Value . ToString ( ) == "LeftCell_2" ) ;
537535
538- Assert . AreEqual ( 10 , ws . CellsUsed ( ) . Count ( ) ) ;
536+ Assert . AreEqual ( 10 , ws . CellsUsed ( XLCellsUsedOptions . Contents ) . Count ( ) ) ;
539537 Assert . AreEqual ( rangeStartCell , ws . Cell ( 6 , 5 ) ) ;
540538 Assert . AreEqual ( rangeEndCell , ws . Cell ( 9 , 7 ) ) ;
541539 Assert . AreEqual ( belowCell1 , ws . Cell ( 10 , 6 ) ) ;
@@ -566,7 +564,7 @@ public void TestAllocateSpaceForNextRange()
566564 leftCell1 = ws . Cells ( ) . Single ( c => c . Value . ToString ( ) == "LeftCell_1" ) ;
567565 leftCell2 = ws . Cells ( ) . Single ( c => c . Value . ToString ( ) == "LeftCell_2" ) ;
568566
569- Assert . AreEqual ( 10 , ws . CellsUsed ( ) . Count ( ) ) ;
567+ Assert . AreEqual ( 10 , ws . CellsUsed ( XLCellsUsedOptions . Contents ) . Count ( ) ) ;
570568 Assert . AreEqual ( rangeStartCell , ws . Cell ( 6 , 5 ) ) ;
571569 Assert . AreEqual ( rangeEndCell , ws . Cell ( 9 , 7 ) ) ;
572570 Assert . AreEqual ( belowCell1 , ws . Cell ( 10 , 6 ) ) ;
@@ -604,7 +602,7 @@ public void TestDeleteRange()
604602
605603 Assert . IsNull ( rangeStartCell ) ;
606604 Assert . IsNull ( rangeEndCell ) ;
607- Assert . AreEqual ( 8 , ws . CellsUsed ( ) . Count ( ) ) ;
605+ Assert . AreEqual ( 8 , ws . CellsUsed ( XLCellsUsedOptions . Contents ) . Count ( ) ) ;
608606 Assert . AreEqual ( belowCell1 , ws . Cell ( 6 , 6 ) ) ;
609607 Assert . AreEqual ( belowCell2 , ws . Cell ( 10 , 8 ) ) ;
610608 Assert . AreEqual ( rightCell1 , ws . Cell ( 7 , 8 ) ) ;
@@ -636,7 +634,7 @@ public void TestDeleteRange()
636634 Assert . IsNull ( rangeEndCell ) ;
637635 Assert . IsNull ( leftCell1 ) ;
638636 Assert . IsNull ( rightCell1 ) ;
639- Assert . AreEqual ( 6 , ws . CellsUsed ( ) . Count ( ) ) ;
637+ Assert . AreEqual ( 6 , ws . CellsUsed ( XLCellsUsedOptions . Contents ) . Count ( ) ) ;
640638 Assert . AreEqual ( belowCell1 , ws . Cell ( 6 , 6 ) ) ;
641639 Assert . AreEqual ( belowCell2 , ws . Cell ( 6 , 8 ) ) ;
642640 Assert . AreEqual ( rightCell2 , ws . Cell ( 5 , 8 ) ) ;
@@ -664,7 +662,7 @@ public void TestDeleteRange()
664662
665663 Assert . IsNull ( rangeStartCell ) ;
666664 Assert . IsNull ( rangeEndCell ) ;
667- Assert . AreEqual ( 8 , ws . CellsUsed ( ) . Count ( ) ) ;
665+ Assert . AreEqual ( 8 , ws . CellsUsed ( XLCellsUsedOptions . Contents ) . Count ( ) ) ;
668666 Assert . AreEqual ( belowCell1 , ws . Cell ( 10 , 6 ) ) ;
669667 Assert . AreEqual ( belowCell2 , ws . Cell ( 10 , 8 ) ) ;
670668 Assert . AreEqual ( rightCell1 , ws . Cell ( 7 , 5 ) ) ;
@@ -696,7 +694,7 @@ public void TestDeleteRange()
696694 Assert . IsNull ( rangeEndCell ) ;
697695 Assert . IsNull ( aboveCell1 ) ;
698696 Assert . IsNull ( belowCell1 ) ;
699- Assert . AreEqual ( 6 , ws . CellsUsed ( ) . Count ( ) ) ;
697+ Assert . AreEqual ( 6 , ws . CellsUsed ( XLCellsUsedOptions . Contents ) . Count ( ) ) ;
700698 Assert . AreEqual ( belowCell2 , ws . Cell ( 10 , 5 ) ) ;
701699 Assert . AreEqual ( rightCell1 , ws . Cell ( 7 , 5 ) ) ;
702700 Assert . AreEqual ( rightCell2 , ws . Cell ( 5 , 5 ) ) ;
@@ -726,7 +724,7 @@ public void TestDeleteRange()
726724 Assert . IsNull ( rangeEndCell ) ;
727725 Assert . AreEqual ( XLBorderStyleValues . None , range . FirstCell ( ) . Style . Border . TopBorder ) ;
728726 Assert . AreEqual ( XLBorderStyleValues . None , range . LastCell ( ) . Style . Border . BottomBorder ) ;
729- Assert . AreEqual ( 8 , ws . CellsUsed ( ) . Count ( ) ) ;
727+ Assert . AreEqual ( 8 , ws . CellsUsed ( XLCellsUsedOptions . Contents ) . Count ( ) ) ;
730728 Assert . AreEqual ( belowCell1 , ws . Cell ( 10 , 6 ) ) ;
731729 Assert . AreEqual ( belowCell2 , ws . Cell ( 10 , 8 ) ) ;
732730 Assert . AreEqual ( rightCell1 , ws . Cell ( 7 , 8 ) ) ;
@@ -757,7 +755,7 @@ public void TestMoveRange()
757755
758756 IXLRange movedRange = ExcelHelper . MoveRange ( range , ws . Cell ( 10 , 8 ) ) ;
759757
760- Assert . AreEqual ( 2 , ws . CellsUsed ( ) . Count ( ) ) ;
758+ Assert . AreEqual ( 2 , ws . CellsUsed ( XLCellsUsedOptions . Contents ) . Count ( ) ) ;
761759 Assert . AreEqual ( range . FirstCell ( ) , ws . Cell ( 6 , 5 ) ) ;
762760 Assert . AreEqual ( range . LastCell ( ) , ws . Cell ( 9 , 7 ) ) ;
763761 Assert . AreEqual ( string . Empty , range . FirstCell ( ) . Value . ToString ( ) ) ;
@@ -771,11 +769,10 @@ public void TestMoveRange()
771769 Assert . AreEqual ( XLBorderStyleValues . Thin , movedRange . FirstCell ( ) . Style . Border . TopBorder ) ;
772770 Assert . AreEqual ( XLBorderStyleValues . Thin , movedRange . LastCell ( ) . Style . Border . BottomBorder ) ;
773771 Assert . AreEqual ( XLDataType . Text , ws . Cell ( 11 , 9 ) . DataType ) ;
774- //Assert.AreEqual(XLCellValues.Text, ws.Cell(11, 9).DataType);
775772
776773 IXLRange movedRange2 = ExcelHelper . MoveRange ( movedRange , ws . Cell ( 11 , 8 ) ) ;
777774
778- Assert . AreEqual ( 2 , ws . CellsUsed ( ) . Count ( ) ) ;
775+ Assert . AreEqual ( 2 , ws . CellsUsed ( XLCellsUsedOptions . Contents ) . Count ( ) ) ;
779776 Assert . AreEqual ( movedRange . FirstCell ( ) , ws . Cell ( 10 , 8 ) ) ;
780777 Assert . AreEqual ( movedRange . LastCell ( ) , ws . Cell ( 13 , 10 ) ) ;
781778 Assert . AreEqual ( string . Empty , movedRange . FirstCell ( ) . Value . ToString ( ) ) ;
@@ -808,14 +805,13 @@ public void TestMoveNamedRange()
808805
809806 ws . Cell ( 11 , 9 ) . Value = DateTime . Now ;
810807 ws . Cell ( 11 , 9 ) . DataType = XLDataType . DateTime ;
811- //ws.Cell(11, 9).DataType = XLCellValues.DateTime;
812808
813809 IXLNamedRange movedNamedRange = ExcelHelper . MoveNamedRange ( namedRange , ws . Cell ( 10 , 8 ) ) ;
814810 IXLRange movedRange = movedNamedRange . Ranges . ElementAt ( 0 ) ;
815811
816812 Assert . AreEqual ( movedNamedRange , ws . NamedRange ( "TestRange" ) ) ;
817813 Assert . AreEqual ( 1 , movedNamedRange . Ranges . Count ) ;
818- Assert . AreEqual ( 2 , ws . CellsUsed ( ) . Count ( ) ) ;
814+ Assert . AreEqual ( 2 , ws . CellsUsed ( XLCellsUsedOptions . Contents ) . Count ( ) ) ;
819815 Assert . AreEqual ( range . FirstCell ( ) , ws . Cell ( 6 , 5 ) ) ;
820816 Assert . AreEqual ( range . LastCell ( ) , ws . Cell ( 9 , 7 ) ) ;
821817 Assert . AreEqual ( string . Empty , range . FirstCell ( ) . Value . ToString ( ) ) ;
@@ -829,14 +825,13 @@ public void TestMoveNamedRange()
829825 Assert . AreEqual ( XLBorderStyleValues . Thin , movedRange . FirstCell ( ) . Style . Border . TopBorder ) ;
830826 Assert . AreEqual ( XLBorderStyleValues . Thin , movedRange . LastCell ( ) . Style . Border . BottomBorder ) ;
831827 Assert . AreEqual ( XLDataType . Text , ws . Cell ( 11 , 9 ) . DataType ) ;
832- //Assert.AreEqual(XLCellValues.Text, ws.Cell(11, 9).DataType);
833828
834829 IXLNamedRange movedNamedRange2 = ExcelHelper . MoveNamedRange ( movedNamedRange , ws . Cell ( 11 , 8 ) ) ;
835830 IXLRange movedRange2 = movedNamedRange2 . Ranges . ElementAt ( 0 ) ;
836831
837832 Assert . AreEqual ( movedNamedRange2 , ws . NamedRange ( "TestRange" ) ) ;
838833 Assert . AreEqual ( 1 , movedNamedRange2 . Ranges . Count ) ;
839- Assert . AreEqual ( 2 , ws . CellsUsed ( ) . Count ( ) ) ;
834+ Assert . AreEqual ( 2 , ws . CellsUsed ( XLCellsUsedOptions . Contents ) . Count ( ) ) ;
840835 Assert . AreEqual ( movedRange . FirstCell ( ) , ws . Cell ( 10 , 8 ) ) ;
841836 Assert . AreEqual ( movedRange . LastCell ( ) , ws . Cell ( 13 , 10 ) ) ;
842837 Assert . AreEqual ( string . Empty , movedRange . FirstCell ( ) . Value . ToString ( ) ) ;
0 commit comments