// Type: long?, selector function is called public static int Test4g() { Data_Nlong[] source = new Data_Nlong[] { new Data_Nlong { name = "Tim", num = 40L }, new Data_Nlong { name = "John", num = null }, new Data_Nlong { name = "Bob", num = 30L } }; double?expected = 35; var actual = source.Average((e) => e.num); return((expected == actual) ? 0 : 1); }
// Type: long?, selector function is called public static int Test4g() { Data_Nlong[] source = new Data_Nlong[]{ new Data_Nlong{name="Tim", num=10L}, new Data_Nlong{name="John", num=Int32.MaxValue}, new Data_Nlong{name="Bob", num=null} }; long expected = (long)Int32.MaxValue + 10; var actual = source.Sum((e) => e.num); return ((expected == actual) ? 0 : 1); }
// Type: long?, selector function is called public static int Test4g() { Data_Nlong[] source = new Data_Nlong[]{ new Data_Nlong{name="Tim", num=40L}, new Data_Nlong{name="John", num=null}, new Data_Nlong{name="Bob", num=30L} }; double? expected = 35; var actual = source.Average((e) => e.num); return ((expected == actual) ? 0 : 1); }
// Type: long?, selector function is called public static int Test4g() { Data_Nlong[] source = new Data_Nlong[]{ new Data_Nlong{name="Tim", num=null}, new Data_Nlong{name="John", num=-105L}, new Data_Nlong{name="Bob", num=Int64.MaxValue} }; long? expected = Int64.MaxValue; var actual = source.Max((e) => e.num); return ((expected == actual) ? 0 : 1); }