本文整理汇总了C#中System.Data.SqlClient.ManualTesting.Tests.SqlRandomTableColumn类的典型用法代码示例。如果您正苦于以下问题:C# SqlRandomTableColumn类的具体用法?C# SqlRandomTableColumn怎么用?C# SqlRandomTableColumn使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SqlRandomTableColumn类属于System.Data.SqlClient.ManualTesting.Tests命名空间,在下文中一共展示了SqlRandomTableColumn类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: SqlRandomTable
public SqlRandomTable(SqlRandomTableColumn[] columns, int? primaryKeyColumnIndex = null, int estimatedRowCount = 0)
{
if (columns == null || columns.Length == 0)
throw new ArgumentException("non-empty type array is required");
if (estimatedRowCount < 0)
throw new ArgumentOutOfRangeException("non-negative row count is required, use 0 for default");
if (primaryKeyColumnIndex.HasValue && (primaryKeyColumnIndex.Value < 0 || primaryKeyColumnIndex.Value >= columns.Length))
throw new ArgumentOutOfRangeException("primaryColumnIndex");
PrimaryKeyColumnIndex = primaryKeyColumnIndex;
_columns = (SqlRandomTableColumn[])columns.Clone();
_columnNames = new string[columns.Length];
if (estimatedRowCount == 0)
_rows = new List<object[]>();
else
_rows = new List<object[]>(estimatedRowCount);
Columns = new List<SqlRandomTableColumn>(_columns).AsReadOnly();
ColumnNames = new List<string>(_columnNames).AsReadOnly();
bool hasSparse = false;
double totalNonSparse = 0;
foreach (var c in _columns)
{
if (c.IsSparse)
{
hasSparse = true;
}
else
{
totalNonSparse += c.GetInRowSize(null); // for non-sparse columns size does not depend on the value
}
}
HasSparseColumns = hasSparse;
NonSparseValuesTotalSize = totalNonSparse;
}
开发者ID:ChuangYang,项目名称:corefx,代码行数:35,代码来源:SqlRandomTable.cs
示例2: GetTSqlTypeDefinitionInternal
protected override string GetTSqlTypeDefinitionInternal(SqlRandomTableColumn columnInfo)
{
string sizeSuffix;
if (!columnInfo.StorageSize.HasValue)
{
sizeSuffix = DefaultSize.ToString();
}
else
{
int size = columnInfo.StorageSize.Value;
if (size > MaxDefinedSize)
{
sizeSuffix = "max";
}
else
{
Debug.Assert(size > 0, "wrong size");
sizeSuffix = size.ToString();
}
}
return string.Format("{0}({1})", TypePrefix, sizeSuffix);
}
开发者ID:ESgarbi,项目名称:corefx,代码行数:22,代码来源:SqlRandomTypesForSqlServer.cs
示例3: CompareValuesInternal
protected override bool CompareValuesInternal(SqlRandomTableColumn columnInfo, object expected, object actual)
{
if ((columnInfo.Options & SqlRandomColumnOptions.ColumnSet) != 0)
{
throw new InvalidOperationException("should not be used for ColumnSet columns - use CanCompareValues before calling this method");
}
return CompareCharArray(expected, actual, allowIncomplete: false);
}
开发者ID:ESgarbi,项目名称:corefx,代码行数:8,代码来源:SqlRandomTypesForSqlServer.cs
示例4: ReadInternal
protected override object ReadInternal(DbDataReader reader, int ordinal, SqlRandomTableColumn columnInfo, Type asType)
{
return ReadByteArray(reader, ordinal, asType);
}
开发者ID:ESgarbi,项目名称:corefx,代码行数:4,代码来源:SqlRandomTypesForSqlServer.cs
示例5: GetInRowSizeInternal
protected override double GetInRowSizeInternal(SqlRandomTableColumn columnInfo)
{
return GetCharSize(columnInfo) * 2; // nchar is not stored in row
}
开发者ID:ESgarbi,项目名称:corefx,代码行数:4,代码来源:SqlRandomTypesForSqlServer.cs
示例6: GetCharSize
private int GetCharSize(SqlRandomTableColumn columnInfo)
{
ValidateColumnInfo(columnInfo);
int charSize = columnInfo.StorageSize.HasValue ? columnInfo.StorageSize.Value / 2 : DefaultCharSize;
if (charSize < 1 || charSize > MaxCharSize)
throw new NotSupportedException("wrong size");
return charSize;
}
开发者ID:ESgarbi,项目名称:corefx,代码行数:10,代码来源:SqlRandomTypesForSqlServer.cs
示例7: CreateRandomValueInternal
protected override object CreateRandomValueInternal(SqlRandomizer rand, SqlRandomTableColumn columnInfo)
{
int size = columnInfo.StorageSize.HasValue ? columnInfo.StorageSize.Value : DefaultCharSize;
return rand.NextAnsiArray(0, size);
}
开发者ID:ESgarbi,项目名称:corefx,代码行数:5,代码来源:SqlRandomTypesForSqlServer.cs
示例8: CanCompareValues
public override bool CanCompareValues(SqlRandomTableColumn columnInfo)
{
// completely ignore TIMESTAMP value comparison
return false;
}
开发者ID:ESgarbi,项目名称:corefx,代码行数:5,代码来源:SqlRandomTypesForSqlServer.cs
注:本文中的System.Data.SqlClient.ManualTesting.Tests.SqlRandomTableColumn类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论