コード例 #1
0
ファイル: SumTests.cs プロジェクト: jmhardison/corefx
            // Type: long, selector function is called
            public static int Test3f()
            {
                Data_long[] source = new Data_long[]{ new Data_long{name="Tim", num=10L},
                                                new Data_long{name="John", num=Int32.MaxValue},
                                                new Data_long{name="Bob", num=40L}
            };
                long expected = (long)Int32.MaxValue + 50;

                var actual = source.Sum((e) => e.num);

                return ((expected == actual) ? 0 : 1);
            }