Example #1
0
 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);
 }
 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);
 }
Example #3
0
 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);
 }
 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);
 }
Example #5
0
 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);
 }
 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);
 }
 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);
 }
Example #8
0
 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);
 }
Example #9
0
 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);
 }
Example #10
0
 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);
 }
Example #11
0
 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);
 }
Example #12
0
 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);
 }
Example #13
0
 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);
 }
Example #14
0
 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);
 }
Example #15
0
 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);
 }
 public void IntegerAverageOnTwoTuple()
 {
     var sut = new Tuple<int, int>(1, 2);
       double expected = sut.AsEnumerable().Cast<int>().Average();
       double actual = sut.Average(x => (int) x);
       Assert.AreEqual(expected, actual);
 }
Example #17
0
 public void DoubleMaxOnTwoTuple()
 {
     var sut = new Tuple<double, double>(1, 2);
       double expected = sut.AsEnumerable().Cast<double>().Max();
       double actual = sut.Max(x => (double) x);
       Assert.AreEqual(expected, actual);
 }
Example #18
0
 public void DecimalSumOnSixTuple()
 {
     var sut = new Tuple<decimal, decimal, decimal, decimal, decimal, decimal>(1, 2, 3, 4, 5, 6);
       decimal expected = sut.AsEnumerable().Cast<decimal>().Sum();
       decimal actual = sut.Sum(x => (decimal) x);
       Assert.AreEqual(expected, actual);
 }
Example #19
0
 public void LongCountOnTwoTuple()
 {
     var sut = new Tuple<long, long>(1, 2);
       int expected = sut.AsEnumerable().Cast<long>().Count();
       int actual = sut.Count();
       Assert.AreEqual(expected, actual);
 }
Example #20
0
 public void ShortMinOnTwoTuple()
 {
     var sut = new Tuple<short, short>(1, 2);
       short expected = sut.AsEnumerable().Cast<short>().Min();
       short actual = sut.Min(x => (short) x);
       Assert.AreEqual(expected, actual);
 }
Example #21
0
 public void DoubleCountOnTwoTuple()
 {
     var sut = new Tuple<double, double>(1, 2);
       int expected = sut.AsEnumerable().Cast<double>().Count();
       int actual = sut.Count();
       Assert.AreEqual(expected, actual);
 }
Example #22
0
 public void LongMaxOnTwoTuple()
 {
     var sut = new Tuple<long, long>(1, 2);
       long expected = sut.AsEnumerable().Cast<long>().Max();
       long actual = sut.Max(x => (long) x);
       Assert.AreEqual(expected, actual);
 }
Example #23
0
 public void ShortSumOnThreeTuple()
 {
     var sut = new Tuple<short, short, short>(1, 2, 3);
       short expected = sut.AsEnumerable().Cast<short>().Sum();
       short actual = sut.Sum(x => (short) x);
       Assert.AreEqual(expected, actual);
 }
 public void DecimalCountOnThreeTuple()
 {
     var sut = new Tuple<decimal, decimal, decimal>(1, 2, 3);
       int expected = sut.AsEnumerable().Cast<decimal>().Count();
       int actual = sut.Count();
       Assert.AreEqual(expected, actual);
 }
Example #25
0
 public void Test2TupleIteration()
 {
     var t = new Tuple<int, int>(-1, -2);
       const int expected = -3;
       int actual = 0;
      foreach (int v in t.AsEnumerable()) actual += v;
      Assert.AreEqual(expected, actual);
 }