Esempio n. 1
0
        public static void TupleWithSingleItem()
        {
            IReadOnlyList <decimal> array = EnumerableTuple.AsEnumerable(new ValueTuple <decimal>(10M));

            Single(array);
            Contains(10M, array);
            Equal(10M, array[0]);
            Throws <ArgumentOutOfRangeException>(() => array[1]);

            array = EnumerableTuple.AsEnumerable(new Tuple <decimal>(10M));
            Single(array);
            Contains(10M, array);
            Equal(10M, array[0]);
            Throws <ArgumentOutOfRangeException>(() => array[1]);
        }
Esempio n. 2
0
        public static void TupleWithFourItems()
        {
            IReadOnlyList <decimal> array = EnumerableTuple.AsEnumerable((10M, 20M, 30M, 40M));

            Equal(4, array.Count);
            Contains(10M, array);
            Contains(20M, array);
            Contains(30M, array);
            Contains(40M, array);

            array = EnumerableTuple.AsEnumerable(new Tuple <decimal, decimal, decimal, decimal>(10M, 20M, 30M, 40M));
            Equal(4, array.Count);
            Contains(10M, array);
            Contains(20M, array);
            Contains(30M, array);
            Contains(40M, array);
        }
Esempio n. 3
0
        public static void TupleWithTwoItems()
        {
            IReadOnlyList <decimal> array = EnumerableTuple.AsEnumerable((10M, 20M));

            Equal(2, array.Count);
            Contains(10M, array);
            Contains(20M, array);
            Equal(10M, array[0]);
            Equal(20M, array[1]);

            array = EnumerableTuple.AsEnumerable(new Tuple <decimal, decimal>(10M, 20M));
            Equal(2, array.Count);
            Contains(10M, array);
            Contains(20M, array);
            Equal(10M, array[0]);
            Equal(20M, array[1]);
        }