本文整理汇总了C#中RowSet.GetRows方法的典型用法代码示例。如果您正苦于以下问题:C# RowSet.GetRows方法的具体用法?C# RowSet.GetRows怎么用?C# RowSet.GetRows使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RowSet
的用法示例。
在下文中一共展示了RowSet.GetRows方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: valueComparator
internal static void valueComparator(RowSet rawrowset, List<object[]> insertedRows)
{
List<Row> rowset = rawrowset.GetRows().ToList();
Assert.True(rowset.Count == insertedRows.Count,
string.Format(
"Returned rows count is not equal with the count of rows that were inserted! \n Returned: {0} \n Expected: {1} \n",
rowset.Count, insertedRows.Count));
int i = 0;
foreach (Row row in rowset)
{
if (row.Any(col => col.GetType() == typeof (byte[])))
for (int j = 0; j < row.Length; j++)
{
Assert.AreEqual(insertedRows[i][j], row[j]);
}
else
{
for (int m = 0; m < row.Length; m++)
{
if (!row[m].Equals(insertedRows[i][m]))
{
insertedRows.Reverse(); // To check if needed and why
if (!row[m].Equals(insertedRows[i][m]))
insertedRows.Reverse();
}
Assert.AreEqual(insertedRows[i][m], row[m], "Inserted data does not match with returned data.");
}
}
i++;
}
}
示例2: CqlReader
internal CqlReader(RowSet rows)
{
popul = rows;
for (int idx = 0; idx < popul.Columns.Length; idx++)
colidx.Add(popul.Columns[idx].Name, idx);
enumRows = popul.GetRows();
enumerRows = enumRows.GetEnumerator();
}
示例3: VerifyData
private static void VerifyData(RowSet rowSet, List<object[]> expectedValues)
{
int x = 0;
foreach (Row row in rowSet.GetRows())
{
int y = 0;
object[] objArr = expectedValues[x];
var rowEnum = row.GetEnumerator();
while (rowEnum.MoveNext())
{
var current = rowEnum.Current;
if (objArr[y].GetType() == typeof(byte[]))
{
Assert.AreEqual((byte[])objArr[y], (byte[])current);
}
else if (current.GetType() == typeof(DateTimeOffset))
{
if (objArr[y].GetType() == typeof(long))
{
if ((long)objArr[y] == 0)
{
Assert.True(current.ToString() == "1/1/1970 12:00:00 AM +00:00");
}
else
{
Assert.AreEqual(FromUnixTime((long)objArr[y]), (DateTimeOffset)current, String.Format("Found difference between expected and actual row {0} != {1}", objArr[y].ToString(), current.ToString()));
}
}
else
{
Assert.AreEqual((DateTimeOffset)objArr[y], ((DateTimeOffset)current), String.Format("Found difference between expected and actual row {0} != {1}", objArr[y].ToString(), current.ToString()));
}
}
else
{
Assert.True(objArr[y].Equals(current), String.Format("Found difference between expected and actual row {0} != {1}", objArr[y].ToString(), current.ToString()));
}
y++;
}
x++;
}
}