Exemple #1
0
        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);
            }
        }
Exemple #2
0
        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]);
            }
        }
Exemple #3
0
        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]);
            }
        }
Exemple #4
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);
            }
        }
Exemple #5
0
        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]);
            }
        }
Exemple #6
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]);
            }
        }
Exemple #7
0
        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);
            }
        }
Exemple #8
0
        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]);
            }
        }