コード例 #1
0
        public void op_Shard_IIdentifyShard()
        {
            var identifier = new ShardByValue("one");
            var sheet      = new DerivedDataSheet();

            foreach (var shard in sheet.Shard(identifier))
            {
                Assert.Equal("1", shard.Title);
            }
        }
コード例 #2
0
        public void op_ToDataTable()
        {
            var sheet = new DerivedDataSheet();
            var table = sheet.ToDataTable();

            Assert.Equal(string.Empty, table.TableName);

            foreach (DataRow row in table.Rows)
            {
                Assert.Equal("1", row.Field <string>("one"));
            }
        }
コード例 #3
0
        public void opIndexer_int()
        {
            using (var temp = new TempFile())
            {
                var expected = new DerivedDataSheet();
                var data     = new DerivedDataFile(temp.Info);
                data.Sheets.Add(expected);

                var actual = data[0];

                Assert.Same(expected, actual);
            }
        }
コード例 #4
0
        public void op_ToDataTable_string()
        {
            const string name = "Example";

            var sheet = new DerivedDataSheet();
            var table = sheet.ToDataTable(name);

            Assert.Equal(name, table.TableName);

            foreach (DataRow row in table.Rows)
            {
                Assert.Equal("1", row.Field <string>("one"));
            }
        }
コード例 #5
0
        public void opIndexer_string()
        {
            using (var temp = new TempFile())
            {
                const string title    = "Example";
                var          expected = new DerivedDataSheet
                {
                    Title = title
                };
                var data = new DerivedDataFile(temp.Info);
                data.Sheets.Add(expected);

                var actual = data[title];

                Assert.Same(expected, actual);
            }
        }