本文整理汇总了C#中Tuple.ToArray方法的典型用法代码示例。如果您正苦于以下问题:C# Tuple.ToArray方法的具体用法?C# Tuple.ToArray怎么用?C# Tuple.ToArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tuple
的用法示例。
在下文中一共展示了Tuple.ToArray方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Enumerator_WhenEnumerates1Tuple_ReturnsSelf
public void Enumerator_WhenEnumerates1Tuple_ReturnsSelf()
{
//Arrange
var tuple = new Tuple(new Tuple(null), new Fact(1), null);
//Act
var target = tuple.ToArray();
//Assert
Assert.AreEqual(1, target.Length);
Assert.AreEqual(tuple.RightFact, target[0]);
}
示例2: Enumerator_WhenEnumeratesNTuple_WalksTuplesInOrder
public void Enumerator_WhenEnumeratesNTuple_WalksTuplesInOrder()
{
//Arrange
var tuple0 = new Tuple(null);
var tuple1 = new Tuple(tuple0, new Fact(1), null);
var tuple2 = new Tuple(tuple1, new Fact(2), null);
var tuple3 = new Tuple(tuple2, new Fact(3), null);
//Act
var target = tuple3.ToArray();
//Assert
Assert.AreEqual(3, target.Length);
Assert.AreEqual(tuple1.RightFact, target[0]);
Assert.AreEqual(tuple2.RightFact, target[1]);
Assert.AreEqual(tuple3.RightFact, target[2]);
}