public void ReturnsCorrectNumberOfRows() { var opts = new dcp.lib.DataCopier.Options(); using (var reader = new Xlsx(stream, opts)) { var rows = reader.Next(3); Assert.Equal(3, rows.Count); } }
public void ReadsLastRowValue() { var opts = new dcp.lib.DataCopier.Options(); using (var reader = new Xlsx(stream, opts)) { var row = reader.Next(1); Assert.Equal(new DateTime(2031, 12, 1), row[0][2]); } }
public void ReadsFirstRowValue() { var opts = new DataCopier.Options(); using (var reader = new Xlsx(stream, opts)) { var rows = reader.Next(1); Assert.Equal(1.1, rows[0][0]); } }
public void ReturnsShortListIfNotEnoughRows() { var opts = new dcp.lib.DataCopier.Options(); using (var reader = new Xlsx(stream, opts)) { var rows = reader.Next(9); Assert.Equal(3, rows.Count); } }
public void SkipsColumns() { var opts = new dcp.lib.DataCopier.Options(); opts.skipColumns = 1; using (var reader = new Xlsx(stream, opts)) { var rows = reader.Next(1); Assert.Equal("one", rows[0][0]); } }
public void ReadsSelectedWorksheet() { var opts = new dcp.lib.DataCopier.Options(); opts.worksheetNumber = 1; using (var reader = new Xlsx(stream, opts)) { var rows = reader.Next(1); Assert.Equal(new DateTime(9031, 12, 1), rows[0][2]); } }
public void LeavesRows() { var opts = new dcp.lib.DataCopier.Options(); opts.leaveRows = 1; using (var reader = new Xlsx(stream, opts)) { var rows = reader.Next(9); Assert.Equal(2, rows.Count); } }
public void UsesMaxColumns() { var opts = new dcp.lib.DataCopier.Options(); opts.maxColumns = 1; using (var reader = new Xlsx(stream, opts)) { var rows = reader.Next(1); Assert.Equal(1.1, rows[0][0]); Assert.Single(rows[0]); } }