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


C# Tuple.AsEnumerable方法代码示例

本文整理汇总了C#中Tuple.AsEnumerable方法的典型用法代码示例。如果您正苦于以下问题:C# Tuple.AsEnumerable方法的具体用法?C# Tuple.AsEnumerable怎么用?C# Tuple.AsEnumerable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Tuple的用法示例。


在下文中一共展示了Tuple.AsEnumerable方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DoubleSumOnSixTuple

 public void DoubleSumOnSixTuple()
 {
     var sut = new Tuple<double, double, double, double, double, double>(1, 2, 3, 4, 5, 6);
       double expected = sut.AsEnumerable().Cast<double>().Sum();
       double actual = sut.Sum(x => (double) x);
       Assert.AreEqual(expected, actual);
 }
开发者ID:nicenemo,项目名称:Noaber,代码行数:7,代码来源:TupleSumTests.Double.cs

示例2: DoubleAverageOnThreeTuple

 public void DoubleAverageOnThreeTuple()
 {
     var sut = new Tuple<double, double, double>(1, 2, 3);
       double expected = sut.AsEnumerable().Cast<double>().Average();
       double actual = sut.Average(x => (double) x);
       Assert.AreEqual(expected, actual);
 }
开发者ID:nicenemo,项目名称:Noaber,代码行数:7,代码来源:TupleAverageTests.Double.cs

示例3: IntegerSumOnThreeTuple

 public void IntegerSumOnThreeTuple()
 {
     var sut = new Tuple<int, int, int>(1, 2, 3);
       int expected = sut.AsEnumerable().Cast<int>().Sum();
       int actual = sut.Sum(x => (int) x);
       Assert.AreEqual(expected, actual);
 }
开发者ID:nicenemo,项目名称:Noaber,代码行数:7,代码来源:TupleSumTests.Integer.cs

示例4: IntegerCountOnTwoTuple

 public void IntegerCountOnTwoTuple()
 {
     var sut = new Tuple<int, int>(1, 2);
       int expected = sut.AsEnumerable().Cast<int>().Count();
       int actual = sut.Count();
       Assert.AreEqual(expected, actual);
 }
开发者ID:nicenemo,项目名称:Noaber,代码行数:7,代码来源:TupleCountTests.Integer.cs

示例5: IntegerMinOnSixTuple

 public void IntegerMinOnSixTuple()
 {
     var sut = new Tuple<int, int, int, int, int, int>(1, 2, 3, 4, 5, 6);
       int expected = sut.AsEnumerable().Cast<int>().Min();
       int actual = sut.Min(x => (int) x);
       Assert.AreEqual(expected, actual);
 }
开发者ID:nicenemo,项目名称:Noaber,代码行数:7,代码来源:TupleMinTests.Integer.cs

示例6: ShortAverageOnTwoTuple

 public void ShortAverageOnTwoTuple()
 {
     var sut = new Tuple<short, short>(1, 2);
       double expected = sut.AsEnumerable().Cast<short>().Average();
       double actual = sut.Average(x => (short) x);
       Assert.AreEqual(expected, actual);
 }
开发者ID:nicenemo,项目名称:Noaber,代码行数:7,代码来源:TupleAverageTests.Short.cs

示例7: DecimalAverageOnTwoTuple

 public void DecimalAverageOnTwoTuple()
 {
     var sut = new Tuple<decimal, decimal>(1, 2);
       decimal expected = sut.AsEnumerable().Cast<decimal>().Average();
       decimal actual = sut.Average(x => (decimal) x);
       Assert.AreEqual(expected, actual);
 }
开发者ID:nicenemo,项目名称:Noaber,代码行数:7,代码来源:TupleAverageTests.Decimal.cs

示例8: LongSumOnThreeTuple

 public void LongSumOnThreeTuple()
 {
     var sut = new Tuple<long, long, long>(1, 2, 3);
       long expected = sut.AsEnumerable().Cast<long>().Sum();
       long actual = sut.Sum(x => (long) x);
       Assert.AreEqual(expected, actual);
 }
开发者ID:nicenemo,项目名称:Noaber,代码行数:7,代码来源:TupleSumTests.Long.cs

示例9: ShortCountOnTwoTuple

 public void ShortCountOnTwoTuple()
 {
     var sut = new Tuple<short, short>(1, 2);
       int expected = sut.AsEnumerable().Cast<short>().Count();
       int actual = sut.Count();
       Assert.AreEqual(expected, actual);
 }
开发者ID:nicenemo,项目名称:Noaber,代码行数:7,代码来源:TupleCountTests.Short.cs

示例10: DecimalMinOnThreeTuple

 public void DecimalMinOnThreeTuple()
 {
     var sut = new Tuple<decimal, decimal, decimal>(1, 2, 3);
       decimal expected = sut.AsEnumerable().Cast<decimal>().Min();
       decimal actual = sut.Min(x => (decimal) x);
       Assert.AreEqual(expected, actual);
 }
开发者ID:nicenemo,项目名称:Noaber,代码行数:7,代码来源:TupleMinTests.Decimal.cs

示例11: LongAverageOnTwoTuple

 public void LongAverageOnTwoTuple()
 {
     var sut = new Tuple<long, long>(1, 2);
       double expected = sut.AsEnumerable().Cast<long>().Average();
       double actual = sut.Average(x => (long) x);
       Assert.AreEqual(expected, actual);
 }
开发者ID:nicenemo,项目名称:Noaber,代码行数:7,代码来源:TupleAverageTests.Long.cs

示例12: DoubleMinOnSevenTuple

 public void DoubleMinOnSevenTuple()
 {
     var sut = new Tuple<double, double, double, double, double, double, double>(1, 2, 3, 4, 5, 6, 7);
       double expected = sut.AsEnumerable().Cast<double>().Min();
       double actual = sut.Min(x => (double) x);
       Assert.AreEqual(expected, actual);
 }
开发者ID:nicenemo,项目名称:Noaber,代码行数:7,代码来源:TupleMinTests.Double.cs

示例13: LongMinOnSixTuple

 public void LongMinOnSixTuple()
 {
     var sut = new Tuple<long, long, long, long, long, long>(1, 2, 3, 4, 5, 6);
       long expected = sut.AsEnumerable().Cast<long>().Min();
       long actual = sut.Min(x => (long) x);
       Assert.AreEqual(expected, actual);
 }
开发者ID:nicenemo,项目名称:Noaber,代码行数:7,代码来源:TupleMinTests.Long.cs

示例14: IntegerMaxOnTwoTuple

 public void IntegerMaxOnTwoTuple()
 {
     var sut = new Tuple<int, int>(1, 2);
       int expected = sut.AsEnumerable().Cast<int>().Max();
       int actual = sut.Max(x => (int) x);
       Assert.AreEqual(expected, actual);
 }
开发者ID:nicenemo,项目名称:Noaber,代码行数:7,代码来源:TupleMaxTests.Integer.cs

示例15: ShortMaxOnSixTuple

 public void ShortMaxOnSixTuple()
 {
     var sut = new Tuple<short, short, short, short, short, short>(1, 2, 3, 4, 5, 6);
       short expected = sut.AsEnumerable().Cast<short>().Max();
       short actual = sut.Max(x => (short) x);
       Assert.AreEqual(expected, actual);
 }
开发者ID:nicenemo,项目名称:Noaber,代码行数:7,代码来源:TupleMaxTests.Short.cs


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