本文整理汇总了C#中Tuple.Item方法的典型用法代码示例。如果您正苦于以下问题:C# Tuple.Item方法的具体用法?C# Tuple.Item怎么用?C# Tuple.Item使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tuple
的用法示例。
在下文中一共展示了Tuple.Item方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ItemOnThreeTuple
public void ItemOnThreeTuple()
{
var t = new Tuple<int, int, int>(-1, -2, -3);
Assert.AreEqual(t.Item1, t.Item(0));
Assert.AreEqual(t.Item2, t.Item(1));
Assert.AreEqual(t.Item3, t.Item(2));
}
示例2: ItemOnFourTuple
public void ItemOnFourTuple()
{
var t = new Tuple<int, int, int, int>(-1, -2, -3, -4);
Assert.AreEqual(t.Item1, t.Item(0));
Assert.AreEqual(t.Item2, t.Item(1));
Assert.AreEqual(t.Item3, t.Item(2));
Assert.AreEqual(t.Item4, t.Item(3));
}
示例3: ItemOnSevenTuple
public void ItemOnSevenTuple()
{
var t = new Tuple<int, int, int, int, int, int, int>(-1, -2, -3, -4, -5, -6, -7);
Assert.AreEqual(t.Item1, t.Item(0));
Assert.AreEqual(t.Item2, t.Item(1));
Assert.AreEqual(t.Item3, t.Item(2));
Assert.AreEqual(t.Item4, t.Item(3));
Assert.AreEqual(t.Item5, t.Item(4));
Assert.AreEqual(t.Item6, t.Item(5));
Assert.AreEqual(t.Item7, t.Item(6));
}
示例4: ItemOnTwoTuple
public void ItemOnTwoTuple()
{
var t = new Tuple<int, int>(-1, -2);
Assert.AreEqual(t.Item1, t.Item(0));
Assert.AreEqual(t.Item2, t.Item(1));
}
示例5: ItemOnOneTuple
public void ItemOnOneTuple()
{
var t = new Tuple<int>(-1);
Assert.AreEqual(t.Item1, t.Item(0));
}