Example #1
0
        public static CremaDataTable CreateRandomTable(string prefix, string postfix)
        {
            var dataTable = new CremaDataTable(IdentifierUtility.Next(prefix, postfix));

            dataTable.AddRandomColumns(RandomUtility.Next(MinColumnCount, MaxColumnCount));
            dataTable.AddRandomRows(RandomUtility.Next(MinRowCount, MaxRowCount));
            return(dataTable);
        }
Example #2
0
        public void GetByRandomColumnID()
        {
            var dataTable = new CremaDataTable();

            dataTable.AddRandomColumns();
            var dataColumn1 = dataTable.Columns.Random();
            var dataColumn2 = dataTable.Columns[dataColumn1.ColumnID];

            Assert.AreSame(dataColumn2, dataColumn1);
        }
Example #3
0
        public void ContainsByRandomColumnID()
        {
            var dataTable = new CremaDataTable();

            dataTable.AddRandomColumns();
            var dataColumn1 = dataTable.Columns.Random();
            var result      = dataTable.Columns.Contains(dataColumn1.ColumnID);

            Assert.IsTrue(result);
        }
Example #4
0
        public void IndexOfByNameMany()
        {
            var dataTable = new CremaDataTable();

            dataTable.AddRandomColumns();
            for (var i = 0; i < dataTable.Columns.Count; i++)
            {
                var dataColumn = dataTable.Columns[i];
                var result     = dataTable.Columns.IndexOf(dataColumn.ColumnName);
                Assert.AreEqual(i, result);
            }
        }