예제 #1
0
        public static void Cast_Empty(Labeled <ParallelQuery <int> > labeled, int count)
        {
            ParallelQuery <int> empty = labeled.Item;

            Assert.IsAssignableFrom <ParallelQuery <int> >(empty.Cast <string>().Cast <int>());
            Assert.Empty(empty.Cast <string>().Cast <int>());
            Assert.Empty(empty.Cast <string>().Cast <int>().ToList());
        }
예제 #2
0
        public static void Cast_Unordered_Empty()
        {
            ParallelQuery <int> empty = UnorderedSources.Default(0);

            Assert.IsAssignableFrom <ParallelQuery <int> >(empty.Cast <string>().Cast <int>());
            Assert.Empty(empty.Cast <string>().Cast <int>());
            Assert.Empty(empty.Cast <string>().Cast <int>().ToList());
        }
예제 #3
0
        //
        // Left operator factory methods
        //
        internal static ParallelQuery <int> MakeCast(bool orderPreserved)
        {
            object[] a = Enumerable.Range(0, 100).Cast <object>().ToArray();

            ParallelQuery <object> ipe = a.AsParallel();

            if (orderPreserved)
            {
                ipe = ipe.AsOrdered();
            }
            return(ipe.Cast <int>());
        }