当前位置: 首页>>代码示例>>C#>>正文


C# RowSet.GetRows方法代码示例

本文整理汇总了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++;
     }
 }
开发者ID:mtf30rob,项目名称:csharp-driver,代码行数:31,代码来源:QueryTools.cs

示例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();
 }
开发者ID:rasmus-s,项目名称:csharp-driver,代码行数:8,代码来源:CqlReader.cs

示例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++;
            }
        }
开发者ID:rasmus-s,项目名称:csharp-driver,代码行数:44,代码来源:ParameterizedStatementsTests.cs


注:本文中的RowSet.GetRows方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。