9 new revisions:
Revision: 96c90603bdff
Author: azizatif
Date: Sat Apr 30 05:48:09 2011
Log: Initial import from svn repo @ r241
http://code.google.com/p/linqbridge/source/detail?r=96c90603bdff
Revision: 1c7ea47af913
Author: azizatif
Date: Sat Apr 30 05:48:20 2011
Log: Added tag v1.2 for changeset 96c90603bdff
http://code.google.com/p/linqbridge/source/detail?r=1c7ea47af913
Revision: 6793c8802f84
Author: azizatif
Date: Sat Apr 30 05:50:05 2011
Log: Fixed issue #17: Distinct missing coverage for multiple nulls
case (im...
http://code.google.com/p/linqbridge/source/detail?r=6793c8802f84
Revision: 68aedec033f8
Author: azizatif
Date: Sat Apr 30 05:52:39 2011
Log: Fixed issue #15: Method Take iterates over all elements (imported
from...
http://code.google.com/p/linqbridge/source/detail?r=68aedec033f8
Revision: 10d8fe3bc413
Author: azizatif
Date: Sat Apr 30 05:55:44 2011
Log: Implemented Skip in terms of SkipWhile, for sake of consistency
with T...
http://code.google.com/p/linqbridge/source/detail?r=10d8fe3bc413
Revision: 153ecaa4778f
Author: azizatif
Date: Sat Apr 30 05:58:51 2011
Log: Addressed warning CS0436: ExtensionAttribute in
src\ExtensionAttribute...
http://code.google.com/p/linqbridge/source/detail?r=153ecaa4778f
Revision: b89b0c17fdaa
Author: azizatif
Date: Sat Apr 30 06:00:17 2011
Log: Fixed issue #18: AsEnumerable is not an extension method
(imported fro...
http://code.google.com/p/linqbridge/source/detail?r=b89b0c17fdaa
Revision: 4c97455fb125
Author: azizatif
Date: Sat Apr 30 06:01:11 2011
Log: Updated Operators_AsExtensionMethods test to include also
operators th...
http://code.google.com/p/linqbridge/source/detail?r=4c97455fb125
Revision: 0f434ffce108
Author: azizatif
Date: Sat Apr 30 06:02:19 2011
Log: Fixed issue #19: Min behaves differently (imported from svn r253)
http://code.google.com/p/linqbridge/source/detail?r=0f434ffce108
==============================================================================
Revision: 96c90603bdff
Author: azizatif
Date: Sat Apr 30 05:48:09 2011
Log: Initial import from svn repo @ r241
http://code.google.com/p/linqbridge/source/detail?r=96c90603bdff
Added:
/.hgignore
/.hgsub
/.hgsubstate
/COPYING.txt
/LINQBridge.sln
/build.cmd
/buildw.cmd
/src/Action.cs
/src/Enumerable.cs
/src/Enumerable.g.cs
/src/
Enumerable.g.tt
/src/ExtensionAttribute.cs
/src/Func.cs
/src/IGrouping.cs
/src/ILookup.cs
/src/IOrderedEnumerable.cs
/src/LINQBridge.csproj
/src/LinqBridge.snk
/src/Lookup.cs
/src/OrderedEnumerable.cs
/src/Properties/AssemblyInfo.cs
/src/Public.cs
/src/Tuple.cs
/test/LINQ.Tests/LINQ.Tests.csproj
/test/LINQBridge.Tests/EnumerableFixture.cs
/test/LINQBridge.Tests/LINQBridge.Tests.csproj
/test/LINQBridge.Tests/LINQBridge.Tests.ncover
/test/LINQBridge.Tests/Reader.cs
/test/LINQBridge.Tests/Tester.cs
/test/LINQBridge.Tests/coverage.xml
/test/TestResultsWiki/CamelCase.cs
/test/TestResultsWiki/Program.cs
/test/TestResultsWiki/StringHelper.cs
/test/TestResultsWiki/TestCaseName.cs
/test/TestResultsWiki/TestResultsWiki.csproj
=======================================
--- /dev/null
+++ /.hgignore Sat Apr 30 05:48:09 2011
@@ -0,0 +1,11 @@
+syntax: glob
+bin/**
+*.dll
+*.pdb
+*.user
+*.cache
+*.suo
+obj/**
+_ReSharper.*
+*.orig
+dist/**
=======================================
--- /dev/null
+++ /.hgsub Sat Apr 30 05:48:09 2011
@@ -0,0 +1,1 @@
+tools =
http://tools.linqbridge.googlecode.com/hg
=======================================
--- /dev/null
+++ /.hgsubstate Sat Apr 30 05:48:09 2011
@@ -0,0 +1,1 @@
+6f690f40198e4e7f1bb34d3aa80d9b60411f6eb3 tools
=======================================
--- /dev/null
+++ /COPYING.txt Sat Apr 30 05:48:09 2011
@@ -0,0 +1,12 @@
+LINQBridge Copyright (c) 2007-2009, Atif Aziz, Joseph Albahari
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
+
+- Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
+
+- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
+
+- Neither the name of the original authors nor the names of its
contributors may be used to endorse or promote products derived from this
software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
=======================================
--- /dev/null
+++ /LINQBridge.sln Sat Apr 30 05:48:09 2011
@@ -0,0 +1,42 @@
+
+Microsoft Visual Studio Solution File, Format Version 10.00
+# Visual Studio 2008
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}")
= "LINQBridge", "src\LINQBridge.csproj", "{66621034-90CC-4D1A-B49E-73A13E3B22EF}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}")
= "LINQBridge.Tests", "test\LINQBridge.Tests\LINQBridge.Tests.csproj", "{8CFA0EA5-31B9-43D0-A2D9-A002C2C25121}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}")
= "LINQ.Tests", "test\LINQ.Tests\LINQ.Tests.csproj", "{FF0FB762-A5DB-4AF2-A917-BD185E97F90B}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}")
= "TestResultsWiki", "test\TestResultsWiki\TestResultsWiki.csproj", "{13CDFE15-3BA8-4FA5-B21E-832E56525541}"
+EndProject
+Global
+ GlobalSection(SubversionScc) = preSolution
+ Svn-Managed = True
+ Manager = AnkhSVN - Subversion Support for Visual Studio
+ EndGlobalSection
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {66621034-90CC-4D1A-B49E-73A13E3B22EF}.Debug|Any CPU.ActiveCfg = Debug|
Any CPU
+ {66621034-90CC-4D1A-B49E-73A13E3B22EF}.Debug|Any CPU.Build.0 = Debug|Any
CPU
+ {66621034-90CC-4D1A-B49E-73A13E3B22EF}.Release|Any CPU.ActiveCfg =
Release|Any CPU
+ {66621034-90CC-4D1A-B49E-73A13E3B22EF}.Release|Any CPU.Build.0 = Release|
Any CPU
+ {8CFA0EA5-31B9-43D0-A2D9-A002C2C25121}.Debug|Any CPU.ActiveCfg = Debug|
Any CPU
+ {8CFA0EA5-31B9-43D0-A2D9-A002C2C25121}.Debug|Any CPU.Build.0 = Debug|Any
CPU
+ {8CFA0EA5-31B9-43D0-A2D9-A002C2C25121}.Release|Any CPU.ActiveCfg = Debug|
Any CPU
+ {8CFA0EA5-31B9-43D0-A2D9-A002C2C25121}.Release|Any CPU.Build.0 = Debug|
Any CPU
+ {FF0FB762-A5DB-4AF2-A917-BD185E97F90B}.Debug|Any CPU.ActiveCfg = Debug|
Any CPU
+ {FF0FB762-A5DB-4AF2-A917-BD185E97F90B}.Debug|Any CPU.Build.0 = Debug|Any
CPU
+ {FF0FB762-A5DB-4AF2-A917-BD185E97F90B}.Release|Any CPU.ActiveCfg = Debug|
Any CPU
+ {FF0FB762-A5DB-4AF2-A917-BD185E97F90B}.Release|Any CPU.Build.0 = Debug|
Any CPU
+ {13CDFE15-3BA8-4FA5-B21E-832E56525541}.Debug|Any CPU.ActiveCfg = Debug|
Any CPU
+ {13CDFE15-3BA8-4FA5-B21E-832E56525541}.Debug|Any CPU.Build.0 = Debug|Any
CPU
+ {13CDFE15-3BA8-4FA5-B21E-832E56525541}.Release|Any CPU.ActiveCfg =
Release|Any CPU
+ {13CDFE15-3BA8-4FA5-B21E-832E56525541}.Release|Any CPU.Build.0 = Release|
Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
=======================================
--- /dev/null
+++ /build.cmd Sat Apr 30 05:48:09 2011
@@ -0,0 +1,31 @@
+@echo off
+
+REM LINQBridge
+REM Copyright (c) 2007-9 Atif Aziz, Joseph Albahari. All rights reserved.
+REM
+REM Author(s):
+REM
+REM Atif Aziz,
http://www.raboof.com
+REM
+REM This library is free software; you can redistribute it and/or modify it
+REM under the terms of the New BSD License, a copy of which should have
+REM been delivered along with this distribution.
+REM
+REM THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+REM "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+REM LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+REM PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+REM OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+REM SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+REM LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+REM DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+REM THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+REM (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+REM OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+REM
+REM
-------------------------------------------------------------------------
+REM
+
+for %%i in (Debug Release) do (
+ "%SystemRoot%\Microsoft.NET\Framework\v3.5\msbuild"
/p:Configuration=%%i "%~dp0LINQBridge.sln"
+)
=======================================
--- /dev/null
+++ /buildw.cmd Sat Apr 30 05:48:09 2011
@@ -0,0 +1,3 @@
+@echo off
+call "%~dp0build" %*
+pause
=======================================
--- /dev/null
+++ /src/Action.cs Sat Apr 30 05:48:09 2011
@@ -0,0 +1,43 @@
+#region License, Terms and Author(s)
+//
+// LINQBridge
+// Copyright (c) 2007-9 Atif Aziz, Joseph Albahari. All rights reserved.
+//
+// Author(s):
+//
+// Atif Aziz,
http://www.raboof.com
+//
+// This library is free software; you can redistribute it and/or modify it
+// under the terms of the New BSD License, a copy of which should have
+// been delivered along with this distribution.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+#endregion
+
+// $Id: Action.cs 239 2010-02-05 23:26:23Z azizatif $
+
+namespace System
+{
+#if LINQBRIDGE_LIB
+ public delegate void Action();
+ public delegate void Action<T1, T2>(T1 arg1, T2 arg2);
+ public delegate void Action<T1, T2, T3>(T1 arg1, T2 arg2, T3 arg3);
+ public delegate void Action<T1, T2, T3, T4>(T1 arg1, T2 arg2, T3 arg3,
T4 arg4);
+#else
+ delegate void Action();
+ delegate void Action<T1, T2>(T1 arg1, T2 arg2);
+ delegate void Action<T1, T2, T3>(T1 arg1, T2 arg2, T3 arg3);
+ delegate void Action<T1, T2, T3, T4>(T1 arg1, T2 arg2, T3 arg3, T4
arg4);
+#endif
+}
=======================================
--- /dev/null
+++ /src/Enumerable.cs Sat Apr 30 05:48:09 2011
@@ -0,0 +1,1771 @@
+#region License, Terms and Author(s)
+//
+// LINQBridge
+// Copyright (c) 2007-9 Atif Aziz, Joseph Albahari. All rights reserved.
+//
+// Author(s):
+//
+// Atif Aziz,
http://www.raboof.com
+//
+// This library is free software; you can redistribute it and/or modify it
+// under the terms of the New BSD License, a copy of which should have
+// been delivered along with this distribution.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+#endregion
+
+// $Id: Enumerable.cs 240 2010-10-19 21:49:03Z azizatif $
+
+namespace System.Linq
+{
+ #region Imports
+
+ using System;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Diagnostics;
+ using LinqBridge;
+
+ #endregion
+
+ /// <summary>
+ /// Provides a set of static (Shared in Visual Basic) methods for
+ /// querying objects that implement <see cref="IEnumerable{T}" />.
+ /// </summary>
+
+ static partial class Enumerable
+ {
+ /// <summary>
+ /// Returns the input typed as <see cref="IEnumerable{T}"/>.
+ /// </summary>
+
+ public static IEnumerable<TSource>
AsEnumerable<TSource>(IEnumerable<TSource> source)
+ {
+ return source;
+ }
+
+ /// <summary>
+ /// Returns an empty <see cref="IEnumerable{T}"/> that has the
+ /// specified type argument.
+ /// </summary>
+
+ public static IEnumerable<TResult> Empty<TResult>()
+ {
+ return Sequence<TResult>.Empty;
+ }
+
+ /// <summary>
+ /// Converts the elements of an <see cref="IEnumerable"/> to the
+ /// specified type.
+ /// </summary>
+
+ public static IEnumerable<TResult> Cast<TResult>(
+ this IEnumerable source)
+ {
+ CheckNotNull(source, "source");
+
+ return CastYield<TResult>(source);
+ }
+
+ private static IEnumerable<TResult> CastYield<TResult>(
+ IEnumerable source)
+ {
+ foreach (var item in source)
+ yield return (TResult) item;
+ }
+
+ /// <summary>
+ /// Filters the elements of an <see cref="IEnumerable"/> based on
a specified type.
+ /// </summary>
+
+ public static IEnumerable<TResult> OfType<TResult>(
+ this IEnumerable source)
+ {
+ CheckNotNull(source, "source");
+
+ return OfTypeYield<TResult>(source);
+ }
+
+ private static IEnumerable<TResult> OfTypeYield<TResult>(
+ IEnumerable source)
+ {
+ foreach (var item in source)
+ if (item is TResult)
+ yield return (TResult) item;
+ }
+
+ /// <summary>
+ /// Generates a sequence of integral numbers within a specified
range.
+ /// </summary>
+ /// <param name="start">The value of the first integer in the
sequence.</param>
+ /// <param name="count">The number of sequential integers to
generate.</param>
+
+ public static IEnumerable<int> Range(int start, int count)
+ {
+ if (count < 0)
+ throw new ArgumentOutOfRangeException("count", count,
null);
+
+ var end = (long) start + count;
+ if (end - 1 >= int.MaxValue)
+ throw new ArgumentOutOfRangeException("count", count,
null);
+
+ return RangeYield(start, end);
+ }
+
+ private static IEnumerable<int> RangeYield(int start, long end)
+ {
+ for (var i = start; i < end; i++)
+ yield return i;
+ }
+
+ /// <summary>
+ /// Generates a sequence that contains one repeated value.
+ /// </summary>
+
+ public static IEnumerable<TResult> Repeat<TResult>(TResult
element, int count)
+ {
+ if (count < 0) throw new ArgumentOutOfRangeException("count",
count, null);
+
+ return RepeatYield(element, count);
+ }
+
+ private static IEnumerable<TResult> RepeatYield<TResult>(TResult
element, int count)
+ {
+ for (var i = 0; i < count; i++)
+ yield return element;
+ }
+
+ /// <summary>
+ /// Filters a sequence of values based on a predicate.
+ /// </summary>
+
+ public static IEnumerable<TSource> Where<TSource>(
+ this IEnumerable<TSource> source,
+ Func<TSource, bool> predicate)
+ {
+ CheckNotNull(predicate, "predicate");
+
+ return source.Where((item, i) => predicate(item));
+ }
+
+ /// <summary>
+ /// Filters a sequence of values based on a predicate.
+ /// Each element's index is used in the logic of the predicate
function.
+ /// </summary>
+
+ public static IEnumerable<TSource> Where<TSource>(
+ this IEnumerable<TSource> source,
+ Func<TSource, int, bool> predicate)
+ {
+ CheckNotNull(source, "source");
+ CheckNotNull(predicate, "predicate");
+
+ return WhereYield(source, predicate);
+ }
+
+ private static IEnumerable<TSource> WhereYield<TSource>(
+ IEnumerable<TSource> source,
+ Func<TSource, int, bool> predicate)
+ {
+ var i = 0;
+ foreach (var item in source)
+ if (predicate(item, i++))
+ yield return item;
+ }
+
+ /// <summary>
+ /// Projects each element of a sequence into a new form.
+ /// </summary>
+
+ public static IEnumerable<TResult> Select<TSource, TResult>(
+ this IEnumerable<TSource> source,
+ Func<TSource, TResult> selector)
+ {
+ CheckNotNull(selector, "selector");
+
+ return source.Select((item, i) => selector(item));
+ }
+
+ /// <summary>
+ /// Projects each element of a sequence into a new form by
+ /// incorporating the element's index.
+ /// </summary>
+
+ public static IEnumerable<TResult> Select<TSource, TResult>(
+ this IEnumerable<TSource> source,
+ Func<TSource, int, TResult> selector)
+ {
+ CheckNotNull(source, "source");
+ CheckNotNull(selector, "selector");
+
+ return SelectYield(source, selector);
+ }
+
+ private static IEnumerable<TResult> SelectYield<TSource, TResult>(
+ IEnumerable<TSource> source,
+ Func<TSource, int, TResult> selector)
+ {
+ var i = 0;
+ foreach (var item in source)
+ yield return selector(item, i++);
+ }
+
+ /// <summary>
+ /// Projects each element of a sequence to an <see
cref="IEnumerable{T}" />
+ /// and flattens the resulting sequences into one sequence.
+ /// </summary>
+
+ public static IEnumerable<TResult> SelectMany<TSource, TResult>(
+ this IEnumerable<TSource> source,
+ Func<TSource, IEnumerable<TResult>> selector)
+ {
+ CheckNotNull(selector, "selector");
+
+ return source.SelectMany((item, i) => selector(item));
+ }
+
+ /// <summary>
+ /// Projects each element of a sequence to an <see
cref="IEnumerable{T}" />,
+ /// and flattens the resulting sequences into one sequence. The
+ /// index of each source element is used in the projected form of
+ /// that element.
+ /// </summary>
+
+ public static IEnumerable<TResult> SelectMany<TSource, TResult>(
+ this IEnumerable<TSource> source,
+ Func<TSource, int, IEnumerable<TResult>> selector)
+ {
+ CheckNotNull(selector, "selector");
+
+ return source.SelectMany(selector, (item, subitem) => subitem);
+ }
+
+ /// <summary>
+ /// Projects each element of a sequence to an <see
cref="IEnumerable{T}" />,
+ /// flattens the resulting sequences into one sequence, and invokes
+ /// a result selector function on each element therein.
+ /// </summary>
+
+ public static IEnumerable<TResult> SelectMany<TSource,
TCollection, TResult>(
+ this IEnumerable<TSource> source,
+ Func<TSource, IEnumerable<TCollection>> collectionSelector,
+ Func<TSource, TCollection, TResult> resultSelector)
+ {
+ CheckNotNull(collectionSelector, "collectionSelector");
+
+ return source.SelectMany((item, i) =>
collectionSelector(item), resultSelector);
+ }
+
+ /// <summary>
+ /// Projects each element of a sequence to an <see
cref="IEnumerable{T}" />,
+ /// flattens the resulting sequences into one sequence, and invokes
+ /// a result selector function on each element therein. The index
of
+ /// each source element is used in the intermediate projected form
+ /// of that element.
+ /// </summary>
+
+ public static IEnumerable<TResult> SelectMany<TSource,
TCollection, TResult>(
+ this IEnumerable<TSource> source,
+ Func<TSource, int, IEnumerable<TCollection>>
collectionSelector,
+ Func<TSource, TCollection, TResult> resultSelector)
+ {
+ CheckNotNull(source, "source");
+ CheckNotNull(collectionSelector, "collectionSelector");
+ CheckNotNull(resultSelector, "resultSelector");
+
+ return SelectManyYield(source, collectionSelector,
resultSelector);
+ }
+
+ private static IEnumerable<TResult> SelectManyYield<TSource,
TCollection, TResult>(
+ this IEnumerable<TSource> source,
+ Func<TSource, int, IEnumerable<TCollection>>
collectionSelector,
+ Func<TSource, TCollection, TResult> resultSelector)
+ {
+ var i = 0;
+ foreach (var item in source)
+ foreach (var subitem in collectionSelector(item, i++))
+ yield return resultSelector(item, subitem);
+ }
+
+ /// <summary>
+ /// Returns elements from a sequence as long as a specified
condition is true.
+ /// </summary>
+
+ public static IEnumerable<TSource> TakeWhile<TSource>(
+ this IEnumerable<TSource> source,
+ Func<TSource, bool> predicate)
+ {
+ CheckNotNull(predicate, "predicate");
+
+ return source.TakeWhile((item, i) => predicate(item));
+ }
+
+ /// <summary>
+ /// Returns elements from a sequence as long as a specified
condition is true.
+ /// The element's index is used in the logic of the predicate
function.
+ /// </summary>
+
+ public static IEnumerable<TSource> TakeWhile<TSource>(
+ this IEnumerable<TSource> source,
+ Func<TSource, int, bool> predicate)
+ {
+ CheckNotNull(source, "source");
+ CheckNotNull(predicate, "predicate");
+
+ return TakeWhileYield(source, predicate);
+ }
+
+ private static IEnumerable<TSource> TakeWhileYield<TSource>(
+ this IEnumerable<TSource> source,
+ Func<TSource, int, bool> predicate)
+ {
+ var i = 0;
+ foreach (var item in source)
+ if (predicate(item, i++))
+ yield return item;
+ else
+ break;
+ }
+
+ private static class Futures<T>
+ {
+ public static readonly Func<T> Default = () => default(T);
+ public static readonly Func<T> Undefined = () => { throw new
InvalidOperationException(); };
+ }
+
+ /// <summary>
+ /// Base implementation of First operator.
+ /// </summary>
+
+ private static TSource FirstImpl<TSource>(
+ this IEnumerable<TSource> source,
+ Func<TSource> empty)
+ {
+ CheckNotNull(source, "source");
+ Debug.Assert(empty != null);
+
+ var list = source as IList<TSource>; // optimized case for
lists
+ if (list != null)
+ return list.Count > 0 ? list[0] : empty();
+
+ using (var e = source.GetEnumerator()) // fallback for
enumeration
+ return e.MoveNext() ? e.Current : empty();
+ }
+
+ /// <summary>
+ /// Returns the first element of a sequence.
+ /// </summary>
+
+ public static TSource First<TSource>(
+ this IEnumerable<TSource> source)
+ {
+ return source.FirstImpl(Futures<TSource>.Undefined);
+ }
+
+ /// <summary>
+ /// Returns the first element in a sequence that satisfies a
specified condition.
+ /// </summary>
+
+ public static TSource First<TSource>(
+ this IEnumerable<TSource> source,
+ Func<TSource, bool> predicate)
+ {
+ return First(source.Where(predicate));
+ }
+
+ /// <summary>
+ /// Returns the first element of a sequence, or a default value if
+ /// the sequence contains no elements.
+ /// </summary>
+
+ public static TSource FirstOrDefault<TSource>(
+ this IEnumerable<TSource> source)
+ {
+ return source.FirstImpl(Futures<TSource>.Default);
+ }
+
+ /// <summary>
+ /// Returns the first element of the sequence that satisfies a
+ /// condition or a default value if no such element is found.
+ /// </summary>
+
+ public static TSource FirstOrDefault<TSource>(
+ this IEnumerable<TSource> source,
+ Func<TSource, bool> predicate)
+ {
+ return FirstOrDefault(source.Where(predicate));
+ }
+
+ /// <summary>
+ /// Base implementation of Last operator.
+ /// </summary>
+
+ private static TSource LastImpl<TSource>(
+ this IEnumerable<TSource> source,
+ Func<TSource> empty)
+ {
+ CheckNotNull(source, "source");
+
+ var list = source as IList<TSource>; // optimized case for
lists
+ if (list != null)
+ return list.Count > 0 ? list[list.Count - 1] : empty();
+
+ using (var e = source.GetEnumerator())
+ {
+ if (!e.MoveNext())
+ return empty();
+
+ var last = e.Current;
+ while (e.MoveNext())
+ last = e.Current;
+
+ return last;
+ }
+ }
+
+ /// <summary>
+ /// Returns the last element of a sequence.
+ /// </summary>
+ public static TSource Last<TSource>(
+ this IEnumerable<TSource> source)
+ {
+ return source.LastImpl(Futures<TSource>.Undefined);
+ }
+
+ /// <summary>
+ /// Returns the last element of a sequence that satisfies a
+ /// specified condition.
+ /// </summary>
+
+ public static TSource Last<TSource>(
+ this IEnumerable<TSource> source,
+ Func<TSource, bool> predicate)
+ {
+ return Last(source.Where(predicate));
+ }
+
+ /// <summary>
+ /// Returns the last element of a sequence, or a default value if
+ /// the sequence contains no elements.
+ /// </summary>
+
+ public static TSource LastOrDefault<TSource>(
+ this IEnumerable<TSource> source)
+ {
+ return source.LastImpl(Futures<TSource>.Default);
+ }
+
+ /// <summary>
+ /// Returns the last element of a sequence that satisfies a
+ /// condition or a default value if no such element is found.
+ /// </summary>
+
+ public static TSource LastOrDefault<TSource>(
+ this IEnumerable<TSource> source,
+ Func<TSource, bool> predicate)
+ {
+ return LastOrDefault(source.Where(predicate));
+ }
+
+ /// <summary>
+ /// Base implementation of Single operator.
+ /// </summary>
+
+ private static TSource SingleImpl<TSource>(
+ this IEnumerable<TSource> source,
+ Func<TSource> empty)
+ {
+ CheckNotNull(source, "source");
+
+ using (var e = source.GetEnumerator())
+ {
+ if (e.MoveNext())
+ {
+ var single = e.Current;
+ if (!e.MoveNext())
+ return single;
+
+ throw new InvalidOperationException();
+ }
+
+ return empty();
+ }
+ }
+
+ /// <summary>
+ /// Returns the only element of a sequence, and throws an exception
+ /// if there is not exactly one element in the sequence.
+ /// </summary>
+
+ public static TSource Single<TSource>(
+ this IEnumerable<TSource> source)
+ {
+ return source.SingleImpl(Futures<TSource>.Undefined);
+ }
+
+ /// <summary>
+ /// Returns the only element of a sequence that satisfies a
+ /// specified condition, and throws an exception if more than one
+ /// such element exists.
+ /// </summary>
+
+ public static TSource Single<TSource>(
+ this IEnumerable<TSource> source,
+ Func<TSource, bool> predicate)
+ {
+ return Single(source.Where(predicate));
+ }
+
+ /// <summary>
+ /// Returns the only element of a sequence, or a default value if
+ /// the sequence is empty; this method throws an exception if there
+ /// is more than one element in the sequence.
+ /// </summary>
+
+ public static TSource SingleOrDefault<TSource>(
+ this IEnumerable<TSource> source)
+ {
+ return source.SingleImpl(Futures<TSource>.Default);
+ }
+
+ /// <summary>
+ /// Returns the only element of a sequence that satisfies a
+ /// specified condition or a default value if no such element
+ /// exists; this method throws an exception if more than one
element
+ /// satisfies the condition.
+ /// </summary>
+
+ public static TSource SingleOrDefault<TSource>(
+ this IEnumerable<TSource> source,
+ Func<TSource, bool> predicate)
+ {
+ return SingleOrDefault(source.Where(predicate));
+ }
+
+ /// <summary>
+ /// Returns the element at a specified index in a sequence.
+ /// </summary>
+
+ public static TSource ElementAt<TSource>(
+ this IEnumerable<TSource> source,
+ int index)
+ {
+ CheckNotNull(source, "source");
+
+ if (index < 0)
+ throw new ArgumentOutOfRangeException("index", index,
null);
+
+ var list = source as IList<TSource>;
+ if (list != null)
+ return list[index];
+
+ try
+ {
+ return source.SkipWhile((item, i) => i < index).First();
+ }
+ catch (InvalidOperationException) // if thrown by First
+ {
+ throw new ArgumentOutOfRangeException("index", index,
null);
+ }
+ }
+
+ /// <summary>
+ /// Returns the element at a specified index in a sequence or a
+ /// default value if the index is out of range.
+ /// </summary>
+
+ public static TSource ElementAtOrDefault<TSource>(
+ this IEnumerable<TSource> source,
+ int index)
+ {
+ CheckNotNull(source, "source");
+
+ if (index < 0)
+ return default(TSource);
+
+ var list = source as IList<TSource>;
+ if (list != null)
+ return index < list.Count ? list[index] : default(TSource);
+
+ return source.SkipWhile((item, i) => i <
index).FirstOrDefault();
+ }
+
+ /// <summary>
+ /// Inverts the order of the elements in a sequence.
+ /// </summary>
+
+ public static IEnumerable<TSource> Reverse<TSource>(
+ this IEnumerable<TSource> source)
+ {
+ CheckNotNull(source, "source");
+
+ return ReverseYield(source);
+ }
+
+ private static IEnumerable<TSource>
ReverseYield<TSource>(IEnumerable<TSource> source)
+ {
+ var stack = new Stack<TSource>();
+ foreach (var item in source)
+ stack.Push(item);
+
+ foreach (var item in stack)
+ yield return item;
+ }
+
+ /// <summary>
+ /// Returns a specified number of contiguous elements from the
start
+ /// of a sequence.
+ /// </summary>
+
+ public static IEnumerable<TSource> Take<TSource>(
+ this IEnumerable<TSource> source,
+ int count)
+ {
+ return source.Where((item, i) => i < count);
+ }
+
+ /// <summary>
+ /// Bypasses a specified number of elements in a sequence and then
+ /// returns the remaining elements.
+ /// </summary>
+
+ public static IEnumerable<TSource> Skip<TSource>(
+ this IEnumerable<TSource> source,
+ int count)
+ {
+ return source.Where((item, i) => i >= count);
+ }
+
+ /// <summary>
+ /// Bypasses elements in a sequence as long as a specified
condition
+ /// is true and then returns the remaining elements.
+ /// </summary>
+
+ public static IEnumerable<TSource> SkipWhile<TSource>(
+ this IEnumerable<TSource> source,
+ Func<TSource, bool> predicate)
+ {
+ CheckNotNull(predicate, "predicate");
+
+ return source.SkipWhile((item, i) => predicate(item));
+ }
+
+ /// <summary>
+ /// Bypasses elements in a sequence as long as a specified
condition
+ /// is true and then returns the remaining elements. The element's
+ /// index is used in the logic of the predicate function.
+ /// </summary>
+
+ public static IEnumerable<TSource> SkipWhile<TSource>(
+ this IEnumerable<TSource> source,
+ Func<TSource, int, bool> predicate)
+ {
+ CheckNotNull(source, "source");
+ CheckNotNull(predicate, "predicate");
+
+ return SkipWhileYield(source, predicate);
+ }
+
+ private static IEnumerable<TSource> SkipWhileYield<TSource>(
+ IEnumerable<TSource> source,
+ Func<TSource, int, bool> predicate)
+ {
+ using (var e = source.GetEnumerator())
+ {
+ for (var i = 0; ; i++)
+ {
+ if (!e.MoveNext())
+ yield break;
+
+ if (!predicate(e.Current, i))
+ break;
+ }
+
+ do { yield return e.Current; } while (e.MoveNext());
+ }
+ }
+
+ /// <summary>
+ /// Returns the number of elements in a sequence.
+ /// </summary>
+
+ public static int Count<TSource>(
+ this IEnumerable<TSource> source)
+ {
+ CheckNotNull(source, "source");
+
+ var collection = source as ICollection;
+ return collection != null
+ ? collection.Count
+ : source.Aggregate(0, (count, item) => checked(count +
1));
+ }
+
+ /// <summary>
+ /// Returns a number that represents how many elements in the
+ /// specified sequence satisfy a condition.
+ /// </summary>
+
+ public static int Count<TSource>(
+ this IEnumerable<TSource> source,
+ Func<TSource, bool> predicate)
+ {
+ return Count(source.Where(predicate));
+ }
+
+ /// <summary>
+ /// Returns an <see cref="Int64"/> that represents the total number
+ /// of elements in a sequence.
+ /// </summary>
+
+ public static long LongCount<TSource>(
+ this IEnumerable<TSource> source)
+ {
+ CheckNotNull(source, "source");
+
+ var array = source as Array;
+ return array != null
+ ? array.LongLength
+ : source.Aggregate(0L, (count, item) => count + 1);
+ }
+
+ /// <summary>
+ /// Returns an <see cref="Int64"/> that represents how many
elements
+ /// in a sequence satisfy a condition.
+ /// </summary>
+
+ public static long LongCount<TSource>(
+ this IEnumerable<TSource> source,
+ Func<TSource, bool> predicate)
+ {
+ return LongCount(source.Where(predicate));
+ }
+
+ /// <summary>
+ /// Concatenates two sequences.
+ /// </summary>
+
+ public static IEnumerable<TSource> Concat<TSource>(
+ this IEnumerable<TSource> first,
+ IEnumerable<TSource> second)
+ {
+ CheckNotNull(first, "first");
+ CheckNotNull(second, "second");
+
+ return ConcatYield(first, second);
+ }
+
+ private static IEnumerable<TSource> ConcatYield<TSource>(
+ IEnumerable<TSource> first,
+ IEnumerable<TSource> second)
+ {
+ foreach (var item in first)
+ yield return item;
+
+ foreach (var item in second)
+ yield return item;
+ }
+
+ /// <summary>
+ /// Creates a <see cref="List{T}"/> from an <see
cref="IEnumerable{T}"/>.
+ /// </summary>
+
+ public static List<TSource> ToList<TSource>(
+ this IEnumerable<TSource> source)
+ {
+ CheckNotNull(source, "source");
+
+ return new List<TSource>(source);
+ }
+
+ /// <summary>
+ /// Creates an array from an <see cref="IEnumerable{T}"/>.
+ /// </summary>
+
+ public static TSource[] ToArray<TSource>(
+ this IEnumerable<TSource> source)
+ {
+ return source.ToList().ToArray();
+ }
+
+ /// <summary>
+ /// Returns distinct elements from a sequence by using the default
+ /// equality comparer to compare values.
+ /// </summary>
+
+ public static IEnumerable<TSource> Distinct<TSource>(
+ this IEnumerable<TSource> source)
+ {
+ return Distinct(source, /* comparer */ null);
+ }
+
+ /// <summary>
+ /// Returns distinct elements from a sequence by using a specified
+ /// <see cref="IEqualityComparer{T}"/> to compare values.
+ /// </summary>
+
+ public static IEnumerable<TSource> Distinct<TSource>(
+ this IEnumerable<TSource> source,
+ IEqualityComparer<TSource> comparer)
+ {
+ CheckNotNull(source, "source");
+
+ return DistinctYield(source, comparer);
+ }
+
+ private static IEnumerable<TSource> DistinctYield<TSource>(
+ IEnumerable<TSource> source,
+ IEqualityComparer<TSource> comparer)
+ {
+ var set = new Dictionary<TSource, object>(comparer);
+ var gotNull = false;
+
+ foreach (var item in source)
+ {
+ if (item == null)
+ {
+ if (gotNull)
+ continue;
+ gotNull = true;
+ }
+ else
+ {
+ if (set.ContainsKey(item))
+ continue;
+ set.Add(item, null);
+ }
+
+ yield return item;
+ }
+ }
+
+ /// <summary>
+ /// Creates a <see cref="Lookup{TKey,TElement}" /> from an
+ /// <see cref="IEnumerable{T}" /> according to a specified key
+ /// selector function.
+ /// </summary>
+
+ public static ILookup<TKey, TSource> ToLookup<TSource, TKey>(
+ this IEnumerable<TSource> source,
+ Func<TSource, TKey> keySelector)
+ {
+ return ToLookup(source, keySelector, e => e, /* comparer */
null);
+ }
+
+ /// <summary>
+ /// Creates a <see cref="Lookup{TKey,TElement}" /> from an
+ /// <see cref="IEnumerable{T}" /> according to a specified key
+ /// selector function and a key comparer.
+ /// </summary>
+
+ public static ILookup<TKey, TSource> ToLookup<TSource, TKey>(
+ this IEnumerable<TSource> source,
+ Func<TSource, TKey> keySelector,
+ IEqualityComparer<TKey> comparer)
+ {
+ return ToLookup(source, keySelector, e => e, comparer);
+ }
+
+ /// <summary>
+ /// Creates a <see cref="Lookup{TKey,TElement}" /> from an
+ /// <see cref="IEnumerable{T}" /> according to specified key
+ /// and element selector functions.
+ /// </summary>
+
+ public static ILookup<TKey, TElement> ToLookup<TSource, TKey,
TElement>(
+ this IEnumerable<TSource> source,
+ Func<TSource, TKey> keySelector,
+ Func<TSource, TElement> elementSelector)
+ {
+ return ToLookup(source, keySelector, elementSelector, /*
comparer */ null);
+ }
+
+ /// <summary>
+ /// Creates a <see cref="Lookup{TKey,TElement}" /> from an
+ /// <see cref="IEnumerable{T}" /> according to a specified key
+ /// selector function, a comparer and an element selector function.
+ /// </summary>
+
+ public static ILookup<TKey, TElement> ToLookup<TSource, TKey,
TElement>(
+ this IEnumerable<TSource> source,
+ Func<TSource, TKey> keySelector,
+ Func<TSource, TElement> elementSelector,
+ IEqualityComparer<TKey> comparer)
+ {
+ CheckNotNull(source, "source");
+ CheckNotNull(keySelector, "keySelector");
+ CheckNotNull(elementSelector, "elementSelector");
+
+ var lookup = new Lookup<TKey, TElement>(comparer);
+
+ foreach (var item in source)
+ {
+ var key = keySelector(item);
+
+ var grouping = (Grouping<TKey, TElement>) lookup.Find(key);
+ if (grouping == null)
+ {
+ grouping = new Grouping<TKey, TElement>(key);
+ lookup.Add(grouping);
+ }
+
+ grouping.Add(elementSelector(item));
+ }
+
+ return lookup;
+ }
+
+ /// <summary>
+ /// Groups the elements of a sequence according to a specified key
+ /// selector function.
+ /// </summary>
+
+ public static IEnumerable<IGrouping<TKey, TSource>>
GroupBy<TSource, TKey>(
+ this IEnumerable<TSource> source,
+ Func<TSource, TKey> keySelector)
+ {
+ return GroupBy(source, keySelector, /* comparer */ null);
+ }
+
+ /// <summary>
+ /// Groups the elements of a sequence according to a specified key
+ /// selector function and compares the keys by using a specified
+ /// comparer.
+ /// </summary>
+
+ public static IEnumerable<IGrouping<TKey, TSource>>
GroupBy<TSource, TKey>(
+ this IEnumerable<TSource> source,
+ Func<TSource, TKey> keySelector,
+ IEqualityComparer<TKey> comparer)
+ {
+ return GroupBy(source, keySelector, e => e, comparer);
+ }
+
+ /// <summary>
+ /// Groups the elements of a sequence according to a specified key
+ /// selector function and projects the elements for each group by
+ /// using a specified function.
+ /// </summary>
+
+ public static IEnumerable<IGrouping<TKey, TElement>>
GroupBy<TSource, TKey, TElement>(
+ this IEnumerable<TSource> source,
+ Func<TSource, TKey> keySelector,
+ Func<TSource, TElement> elementSelector)
+ {
+ return GroupBy(source, keySelector, elementSelector, /*
comparer */ null);
+ }
+
+ /// <summary>
+ /// Groups the elements of a sequence according to a specified key
+ /// selector function and creates a result value from each group
and
+ /// its key.
+ /// </summary>
+
+ public static IEnumerable<IGrouping<TKey, TElement>>
GroupBy<TSource, TKey, TElement>(
+ this IEnumerable<TSource> source,
+ Func<TSource, TKey> keySelector,
+ Func<TSource, TElement> elementSelector,
+ IEqualityComparer<TKey> comparer)
+ {
+ CheckNotNull(source, "source");
+ CheckNotNull(keySelector, "keySelector");
+ CheckNotNull(elementSelector, "elementSelector");
+
+ return ToLookup(source, keySelector, elementSelector,
comparer);
+ }
+
+ /// <summary>
+ /// Groups the elements of a sequence according to a key selector
+ /// function. The keys are compared by using a comparer and each
+ /// group's elements are projected by using a specified function.
+ /// </summary>
+
+ public static IEnumerable<TResult> GroupBy<TSource, TKey, TResult>(
+ this IEnumerable<TSource> source,
+ Func<TSource, TKey> keySelector,
+ Func<TKey, IEnumerable<TSource>, TResult> resultSelector)
+ {
+ return GroupBy(source, keySelector, resultSelector, /*
comparer */ null);
***The diff for this file has been truncated for email.***
=======================================
--- /dev/null
+++ /src/Enumerable.g.cs Sat Apr 30 05:48:09 2011
@@ -0,0 +1,974 @@
+#region License, Terms and Author(s)
+//
+// LINQBridge
+// Copyright (c) 2007-9 Atif Aziz, Joseph Albahari. All rights reserved.
+//
+// Author(s):
+//
+// Atif Aziz,
http://www.raboof.com
+//
+// This library is free software; you can redistribute it and/or modify it
+// under the terms of the New BSD License, a copy of which should have
+// been delivered along with this distribution.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+#endregion
+
+// $Id: Enumerable.g.cs 215 2009-10-03 13:31:49Z azizatif $
+
+namespace System.Linq
+{
+ #region Imports
+
+ using System;
+ using System.Collections.Generic;
+
+ #endregion
+
+ // This partial implementation was template-generated:
+ // Sat, 03 Oct 2009 09:42:39 GMT
+
+ partial class Enumerable
+ {
+ /// <summary>
+ /// Computes the sum of a sequence of nullable <see
cref="System.Int32" /> values.
+ /// </summary>
+
+ public static int Sum(
+ this IEnumerable<int> source)
+ {
+ CheckNotNull(source, "source");
+
+ int sum = 0;
+ foreach (var num in source)
+ sum = checked(sum + num);
+
+ return sum;
+ }
+
+ /// <summary>
+ /// Computes the sum of a sequence of nullable <see
cref="System.Int32" />
+ /// values that are obtained by invoking a transform function on
+ /// each element of the input sequence.
+ /// </summary>
+
+ public static int Sum<TSource>(
+ this IEnumerable<TSource> source,
+ Func<TSource, int> selector)
+ {
+ return source.Select(selector).Sum();
+ }
+
+ /// <summary>
+ /// Computes the average of a sequence of nullable <see
cref="System.Int32" /> values.
+ /// </summary>
+
+ public static double Average(
+ this IEnumerable<int> source)
+ {
+ CheckNotNull(source, "source");
+
+ long sum = 0;
+ long count = 0;
+
+ foreach (var num in source)
+ checked
+ {
+ sum += (int) num;
+ count++;
+ }
+
+ if (count == 0)
+ throw new InvalidOperationException();
+
+ return (double) sum / count;
+ }
+
+ /// <summary>
+ /// Computes the average of a sequence of nullable <see
cref="System.Int32" /> values
+ /// that are obtained by invoking a transform function on each
+ /// element of the input sequence.
+ /// </summary>
+
+ public static double Average<TSource>(
+ this IEnumerable<TSource> source,
+ Func<TSource, int> selector)
+ {
+ return source.Select(selector).Average();
+ }
+
+
+ /// <summary>
+ /// Computes the sum of a sequence of <see cref="System.Int32" />
values.
+ /// </summary>
+
+ public static int? Sum(
+ this IEnumerable<int?> source)
+ {
+ CheckNotNull(source, "source");
+
+ int sum = 0;
+ foreach (var num in source)
+ sum = checked(sum + (num ?? 0));
+
+ return sum;
+ }
+
+ /// <summary>
+ /// Computes the sum of a sequence of <see cref="System.Int32" />
+ /// values that are obtained by invoking a transform function on
+ /// each element of the input sequence.
+ /// </summary>
+
+ public static int? Sum<TSource>(
+ this IEnumerable<TSource> source,
+ Func<TSource, int?> selector)
+ {
+ return source.Select(selector).Sum();
+ }
+
+ /// <summary>
+ /// Computes the average of a sequence of <see cref="System.Int32"
/> values.
+ /// </summary>
+
+ public static double? Average(
+ this IEnumerable<int?> source)
+ {
+ CheckNotNull(source, "source");
+
+ long sum = 0;
+ long count = 0;
+
+ foreach (var num in source.Where(n => n != null))
+ checked
+ {
+ sum += (int) num;
+ count++;
+ }
+
+ if (count == 0)
+ return null;
+
+ return (double?) sum / count;
+ }
+
+ /// <summary>
+ /// Computes the average of a sequence of <see cref="System.Int32"
/> values
+ /// that are obtained by invoking a transform function on each
+ /// element of the input sequence.
+ /// </summary>
+
+ public static double? Average<TSource>(
+ this IEnumerable<TSource> source,
+ Func<TSource, int?> selector)
+ {
+ return source.Select(selector).Average();
+ }
+
+ /// <summary>
+ /// Returns the minimum value in a sequence of nullable
+ /// <see cref="System.Int32" /> values.
+ /// </summary>
+
+ public static int? Min(
+ this IEnumerable<int?> source)
+ {
+ CheckNotNull(source, "source");
+
+ return MinMaxImpl(source.Where(x => x != null), null, (min, x)
=> min < x);
+ }
+
+ /// <summary>
+ /// Invokes a transform function on each element of a sequence and
+ /// returns the minimum nullable <see cref="System.Int32" /> value.
+ /// </summary>
+
+ public static int? Min<TSource>(
+ this IEnumerable<TSource> source,
+ Func<TSource, int?> selector)
+ {
+ return source.Select(selector).Min();
+ }
+
+ /// <summary>
+ /// Returns the maximum value in a sequence of nullable
+ /// <see cref="System.Int32" /> values.
+ /// </summary>
+
+ public static int? Max(
+ this IEnumerable<int?> source)
+ {
+ CheckNotNull(source, "source");
+
+ return MinMaxImpl(source.Where(x => x != null),
+ null, (max, x) => x == null || (max != null && x.Value <
max.Value));
+ }
+
+ /// <summary>
+ /// Invokes a transform function on each element of a sequence and
+ /// returns the maximum nullable <see cref="System.Int32" /> value.
+ /// </summary>
+
+ public static int? Max<TSource>(
+ this IEnumerable<TSource> source,
+ Func<TSource, int?> selector)
+ {
+ return source.Select(selector).Max();
+ }
+
+ /// <summary>
+ /// Computes the sum of a sequence of nullable <see
cref="System.Int64" /> values.
+ /// </summary>
+
+ public static long Sum(
+ this IEnumerable<long> source)
+ {
+ CheckNotNull(source, "source");
+
+ long sum = 0;
+ foreach (var num in source)
+ sum = checked(sum + num);
+
+ return sum;
+ }
+
+ /// <summary>
+ /// Computes the sum of a sequence of nullable <see
cref="System.Int64" />
+ /// values that are obtained by invoking a transform function on
+ /// each element of the input sequence.
+ /// </summary>
+
+ public static long Sum<TSource>(
+ this IEnumerable<TSource> source,
+ Func<TSource, long> selector)
+ {
+ return source.Select(selector).Sum();
+ }
+
+ /// <summary>
+ /// Computes the average of a sequence of nullable <see
cref="System.Int64" /> values.
+ /// </summary>
+
+ public static double Average(
+ this IEnumerable<long> source)
+ {
+ CheckNotNull(source, "source");
+
+ long sum = 0;
+ long count = 0;
+
+ foreach (var num in source)
+ checked
+ {
+ sum += (long) num;
+ count++;
+ }
+
+ if (count == 0)
+ throw new InvalidOperationException();
+
+ return (double) sum / count;
+ }
+
+ /// <summary>
+ /// Computes the average of a sequence of nullable <see
cref="System.Int64" /> values
+ /// that are obtained by invoking a transform function on each
+ /// element of the input sequence.
+ /// </summary>
+
+ public static double Average<TSource>(
+ this IEnumerable<TSource> source,
+ Func<TSource, long> selector)
+ {
+ return source.Select(selector).Average();
+ }
+
+
+ /// <summary>
+ /// Computes the sum of a sequence of <see cref="System.Int64" />
values.
+ /// </summary>
+
+ public static long? Sum(
+ this IEnumerable<long?> source)
+ {
+ CheckNotNull(source, "source");
+
+ long sum = 0;
+ foreach (var num in source)
+ sum = checked(sum + (num ?? 0));
+
+ return sum;
+ }
+
+ /// <summary>
+ /// Computes the sum of a sequence of <see cref="System.Int64" />
+ /// values that are obtained by invoking a transform function on
+ /// each element of the input sequence.
+ /// </summary>
+
+ public static long? Sum<TSource>(
+ this IEnumerable<TSource> source,
+ Func<TSource, long?> selector)
+ {
+ return source.Select(selector).Sum();
+ }
+
+ /// <summary>
+ /// Computes the average of a sequence of <see cref="System.Int64"
/> values.
+ /// </summary>
+
+ public static double? Average(
+ this IEnumerable<long?> source)
+ {
+ CheckNotNull(source, "source");
+
+ long sum = 0;
+ long count = 0;
+
+ foreach (var num in source.Where(n => n != null))
+ checked
+ {
+ sum += (long) num;
+ count++;
+ }
+
+ if (count == 0)
+ return null;
+
+ return (double?) sum / count;
+ }
+
+ /// <summary>
+ /// Computes the average of a sequence of <see cref="System.Int64"
/> values
+ /// that are obtained by invoking a transform function on each
+ /// element of the input sequence.
+ /// </summary>
+
+ public static double? Average<TSource>(
+ this IEnumerable<TSource> source,
+ Func<TSource, long?> selector)
+ {
+ return source.Select(selector).Average();
+ }
+
+ /// <summary>
+ /// Returns the minimum value in a sequence of nullable
+ /// <see cref="System.Int64" /> values.
+ /// </summary>
+
+ public static long? Min(
+ this IEnumerable<long?> source)
+ {
+ CheckNotNull(source, "source");
+
+ return MinMaxImpl(source.Where(x => x != null), null, (min, x)
=> min < x);
+ }
+
+ /// <summary>
+ /// Invokes a transform function on each element of a sequence and
+ /// returns the minimum nullable <see cref="System.Int64" /> value.
+ /// </summary>
+
+ public static long? Min<TSource>(
+ this IEnumerable<TSource> source,
+ Func<TSource, long?> selector)
+ {
+ return source.Select(selector).Min();
+ }
+
+ /// <summary>
+ /// Returns the maximum value in a sequence of nullable
+ /// <see cref="System.Int64" /> values.
+ /// </summary>
+
+ public static long? Max(
+ this IEnumerable<long?> source)
+ {
+ CheckNotNull(source, "source");
+
+ return MinMaxImpl(source.Where(x => x != null),
+ null, (max, x) => x == null || (max != null && x.Value <
max.Value));
+ }
+
+ /// <summary>
+ /// Invokes a transform function on each element of a sequence and
+ /// returns the maximum nullable <see cref="System.Int64" /> value.
+ /// </summary>
+
+ public static long? Max<TSource>(
+ this IEnumerable<TSource> source,
+ Func<TSource, long?> selector)
+ {
+ return source.Select(selector).Max();
+ }
+
+ /// <summary>
+ /// Computes the sum of a sequence of nullable <see
cref="System.Single" /> values.
+ /// </summary>
+
+ public static float Sum(
+ this IEnumerable<float> source)
+ {
+ CheckNotNull(source, "source");
+
+ float sum = 0;
+ foreach (var num in source)
+ sum = checked(sum + num);
+
+ return sum;
+ }
+
+ /// <summary>
+ /// Computes the sum of a sequence of nullable <see
cref="System.Single" />
+ /// values that are obtained by invoking a transform function on
+ /// each element of the input sequence.
+ /// </summary>
+
+ public static float Sum<TSource>(
+ this IEnumerable<TSource> source,
+ Func<TSource, float> selector)
+ {
+ return source.Select(selector).Sum();
+ }
+
+ /// <summary>
+ /// Computes the average of a sequence of nullable <see
cref="System.Single" /> values.
+ /// </summary>
+
+ public static float Average(
+ this IEnumerable<float> source)
+ {
+ CheckNotNull(source, "source");
+
+ float sum = 0;
+ long count = 0;
+
+ foreach (var num in source)
+ checked
+ {
+ sum += (float) num;
+ count++;
+ }
+
+ if (count == 0)
+ throw new InvalidOperationException();
+
+ return (float) sum / count;
+ }
+
+ /// <summary>
+ /// Computes the average of a sequence of nullable <see
cref="System.Single" /> values
+ /// that are obtained by invoking a transform function on each
+ /// element of the input sequence.
+ /// </summary>
+
+ public static float Average<TSource>(
+ this IEnumerable<TSource> source,
+ Func<TSource, float> selector)
+ {
+ return source.Select(selector).Average();
+ }
+
+
+ /// <summary>
+ /// Computes the sum of a sequence of <see cref="System.Single" />
values.
+ /// </summary>
+
+ public static float? Sum(
+ this IEnumerable<float?> source)
+ {
+ CheckNotNull(source, "source");
+
+ float sum = 0;
+ foreach (var num in source)
+ sum = checked(sum + (num ?? 0));
+
+ return sum;
+ }
+
+ /// <summary>
+ /// Computes the sum of a sequence of <see cref="System.Single" />
+ /// values that are obtained by invoking a transform function on
+ /// each element of the input sequence.
+ /// </summary>
+
+ public static float? Sum<TSource>(
+ this IEnumerable<TSource> source,
+ Func<TSource, float?> selector)
+ {
+ return source.Select(selector).Sum();
+ }
+
+ /// <summary>
+ /// Computes the average of a sequence of <see
cref="System.Single" /> values.
+ /// </summary>
+
+ public static float? Average(
+ this IEnumerable<float?> source)
+ {
+ CheckNotNull(source, "source");
+
+ float sum = 0;
+ long count = 0;
+
+ foreach (var num in source.Where(n => n != null))
+ checked
+ {
+ sum += (float) num;
+ count++;
+ }
+
+ if (count == 0)
+ return null;
+
+ return (float?) sum / count;
+ }
+
+ /// <summary>
+ /// Computes the average of a sequence of <see
cref="System.Single" /> values
+ /// that are obtained by invoking a transform function on each
+ /// element of the input sequence.
+ /// </summary>
+
+ public static float? Average<TSource>(
+ this IEnumerable<TSource> source,
+ Func<TSource, float?> selector)
+ {
+ return source.Select(selector).Average();
+ }
+
+ /// <summary>
+ /// Returns the minimum value in a sequence of nullable
+ /// <see cref="System.Single" /> values.
+ /// </summary>
+
+ public static float? Min(
+ this IEnumerable<float?> source)
+ {
+ CheckNotNull(source, "source");
+
+ return MinMaxImpl(source.Where(x => x != null), null, (min, x)
=> min < x);
+ }
+
+ /// <summary>
+ /// Invokes a transform function on each element of a sequence and
+ /// returns the minimum nullable <see cref="System.Single" />
value.
+ /// </summary>
+
+ public static float? Min<TSource>(
+ this IEnumerable<TSource> source,
+ Func<TSource, float?> selector)
+ {
+ return source.Select(selector).Min();
+ }
+
+ /// <summary>
+ /// Returns the maximum value in a sequence of nullable
+ /// <see cref="System.Single" /> values.
+ /// </summary>
+
+ public static float? Max(
+ this IEnumerable<float?> source)
+ {
+ CheckNotNull(source, "source");
+
+ return MinMaxImpl(source.Where(x => x != null),
+ null, (max, x) => x == null || (max != null && x.Value <
max.Value));
+ }
+
+ /// <summary>
+ /// Invokes a transform function on each element of a sequence and
+ /// returns the maximum nullable <see cref="System.Single" />
value.
+ /// </summary>
+
+ public static float? Max<TSource>(
+ this IEnumerable<TSource> source,
+ Func<TSource, float?> selector)
+ {
+ return source.Select(selector).Max();
+ }
+
+ /// <summary>
+ /// Computes the sum of a sequence of nullable <see
cref="System.Double" /> values.
+ /// </summary>
+
+ public static double Sum(
+ this IEnumerable<double> source)
+ {
+ CheckNotNull(source, "source");
+
+ double sum = 0;
+ foreach (var num in source)
+ sum = checked(sum + num);
+
+ return sum;
+ }
+
+ /// <summary>
+ /// Computes the sum of a sequence of nullable <see
cref="System.Double" />
+ /// values that are obtained by invoking a transform function on
+ /// each element of the input sequence.
+ /// </summary>
+
+ public static double Sum<TSource>(
+ this IEnumerable<TSource> source,
+ Func<TSource, double> selector)
+ {
+ return source.Select(selector).Sum();
+ }
+
+ /// <summary>
+ /// Computes the average of a sequence of nullable <see
cref="System.Double" /> values.
+ /// </summary>
+
+ public static double Average(
+ this IEnumerable<double> source)
+ {
+ CheckNotNull(source, "source");
+
+ double sum = 0;
+ long count = 0;
+
+ foreach (var num in source)
+ checked
+ {
+ sum += (double) num;
+ count++;
+ }
+
+ if (count == 0)
+ throw new InvalidOperationException();
+
+ return (double) sum / count;
+ }
+
+ /// <summary>
+ /// Computes the average of a sequence of nullable <see
cref="System.Double" /> values
+ /// that are obtained by invoking a transform function on each
+ /// element of the input sequence.
+ /// </summary>
+
+ public static double Average<TSource>(
+ this IEnumerable<TSource> source,
+ Func<TSource, double> selector)
+ {
+ return source.Select(selector).Average();
+ }
+
+
+ /// <summary>
+ /// Computes the sum of a sequence of <see cref="System.Double" />
values.
+ /// </summary>
+
+ public static double? Sum(
+ this IEnumerable<double?> source)
+ {
+ CheckNotNull(source, "source");
+
+ double sum = 0;
+ foreach (var num in source)
+ sum = checked(sum + (num ?? 0));
+
+ return sum;
+ }
+
+ /// <summary>
+ /// Computes the sum of a sequence of <see cref="System.Double" />
+ /// values that are obtained by invoking a transform function on
+ /// each element of the input sequence.
+ /// </summary>
+
+ public static double? Sum<TSource>(
+ this IEnumerable<TSource> source,
+ Func<TSource, double?> selector)
+ {
+ return source.Select(selector).Sum();
+ }
+
+ /// <summary>
+ /// Computes the average of a sequence of <see
cref="System.Double" /> values.
+ /// </summary>
+
+ public static double? Average(
+ this IEnumerable<double?> source)
+ {
+ CheckNotNull(source, "source");
+
+ double sum = 0;
+ long count = 0;
+
+ foreach (var num in source.Where(n => n != null))
+ checked
+ {
+ sum += (double) num;
+ count++;
+ }
+
+ if (count == 0)
+ return null;
+
+ return (double?) sum / count;
+ }
+
+ /// <summary>
+ /// Computes the average of a sequence of <see
cref="System.Double" /> values
+ /// that are obtained by invoking a transform function on each
+ /// element of the input sequence.
+ /// </summary>
+
+ public static double? Average<TSource>(
+ this IEnumerable<TSource> source,
+ Func<TSource, double?> selector)
+ {
+ return source.Select(selector).Average();
+ }
+
+ /// <summary>
+ /// Returns the minimum value in a sequence of nullable
+ /// <see cref="System.Double" /> values.
+ /// </summary>
+
+ public static double? Min(
+ this IEnumerable<double?> source)
+ {
+ CheckNotNull(source, "source");
+
+ return MinMaxImpl(source.Where(x => x != null), null, (min, x)
=> min < x);
+ }
+
+ /// <summary>
+ /// Invokes a transform function on each element of a sequence and
+ /// returns the minimum nullable <see cref="System.Double" />
value.
+ /// </summary>
+
+ public static double? Min<TSource>(
+ this IEnumerable<TSource> source,
+ Func<TSource, double?> selector)
+ {
+ return source.Select(selector).Min();
+ }
+
+ /// <summary>
+ /// Returns the maximum value in a sequence of nullable
+ /// <see cref="System.Double" /> values.
+ /// </summary>
+
+ public static double? Max(
+ this IEnumerable<double?> source)
+ {
+ CheckNotNull(source, "source");
+
+ return MinMaxImpl(source.Where(x => x != null),
+ null, (max, x) => x == null || (max != null && x.Value <
max.Value));
+ }
+
+ /// <summary>
+ /// Invokes a transform function on each element of a sequence and
+ /// returns the maximum nullable <see cref="System.Double" />
value.
+ /// </summary>
+
+ public static double? Max<TSource>(
+ this IEnumerable<TSource> source,
+ Func<TSource, double?> selector)
+ {
+ return source.Select(selector).Max();
+ }
+
+ /// <summary>
+ /// Computes the sum of a sequence of nullable <see
cref="System.Decimal" /> values.
+ /// </summary>
+
+ public static decimal Sum(
+ this IEnumerable<decimal> source)
+ {
+ CheckNotNull(source, "source");
+
+ decimal sum = 0;
+ foreach (var num in source)
+ sum = checked(sum + num);
+
+ return sum;
+ }
+
+ /// <summary>
+ /// Computes the sum of a sequence of nullable <see
cref="System.Decimal" />
+ /// values that are obtained by invoking a transform function on
+ /// each element of the input sequence.
+ /// </summary>
+
+ public static decimal Sum<TSource>(
+ this IEnumerable<TSource> source,
+ Func<TSource, decimal> selector)
+ {
+ return source.Select(selector).Sum();
+ }
+
+ /// <summary>
+ /// Computes the average of a sequence of nullable <see
cref="System.Decimal" /> values.
+ /// </summary>
+
+ public static decimal Average(
+ this IEnumerable<decimal> source)
+ {
+ CheckNotNull(source, "source");
+
+ decimal sum = 0;
+ long count = 0;
+
+ foreach (var num in source)
+ checked
+ {
+ sum += (decimal) num;
+ count++;
+ }
+
+ if (count == 0)
+ throw new InvalidOperationException();
+
+ return (decimal) sum / count;
+ }
+
+ /// <summary>
+ /// Computes the average of a sequence of nullable <see
cref="System.Decimal" /> values
+ /// that are obtained by invoking a transform function on each
+ /// element of the input sequence.
+ /// </summary>
+
+ public static decimal Average<TSource>(
+ this IEnumerable<TSource> source,
+ Func<TSource, decimal> selector)
+ {
+ return source.Select(selector).Average();
+ }
+
+
+ /// <summary>
+ /// Computes the sum of a sequence of <see cref="System.Decimal"
/> values.
+ /// </summary>
+
+ public static decimal? Sum(
+ this IEnumerable<decimal?> source)
+ {
+ CheckNotNull(source, "source");
+
+ decimal sum = 0;
+ foreach (var num in source)
+ sum = checked(sum + (num ?? 0));
+
+ return sum;
+ }
+
+ /// <summary>
+ /// Computes the sum of a sequence of <see cref="System.Decimal" />
+ /// values that are obtained by invoking a transform function on
+ /// each element of the input sequence.
+ /// </summary>
+
+ public static decimal? Sum<TSource>(
+ this IEnumerable<TSource> source,
+ Func<TSource, decimal?> selector)
+ {
+ return source.Select(selector).Sum();
+ }
+
+ /// <summary>
+ /// Computes the average of a sequence of <see
cref="System.Decimal" /> values.
+ /// </summary>
+
+ public static decimal? Average(
+ this IEnumerable<decimal?> source)
+ {
+ CheckNotNull(source, "source");
+
+ decimal sum = 0;
+ long count = 0;
+
+ foreach (var num in source.Where(n => n != null))
+ checked
+ {
+ sum += (decimal) num;
+ count++;
+ }
+
+ if (count == 0)
+ return null;
+
+ return (decimal?) sum / count;
+ }
+
+ /// <summary>
+ /// Computes the average of a sequence of <see
cref="System.Decimal" /> values
+ /// that are obtained by invoking a transform function on each
+ /// element of the input sequence.
+ /// </summary>
+
+ public static decimal? Average<TSource>(
+ this IEnumerable<TSource> source,
+ Func<TSource, decimal?> selector)
+ {
+ return source.Select(selector).Average();
+ }
+
+ /// <summary>
+ /// Returns the minimum value in a sequence of nullable
+ /// <see cref="System.Decimal" /> values.
+ /// </summary>
+
+ public static decimal? Min(
+ this IEnumerable<decimal?> source)
+ {
+ CheckNotNull(source, "source");
+
+ return MinMaxImpl(source.Where(x => x != null), null, (min, x)
=> min < x);
+ }
+
+ /// <summary>
+ /// Invokes a transform function on each element of a sequence and
+ /// returns the minimum nullable <see cref="System.Decimal" />
value.
+ /// </summary>
+
+ public static decimal? Min<TSource>(
+ this IEnumerable<TSource> source,
+ Func<TSource, decimal?> selector)
+ {
+ return source.Select(selector).Min();
+ }
+
+ /// <summary>
+ /// Returns the maximum value in a sequence of nullable
+ /// <see cref="System.Decimal" /> values.
+ /// </summary>
+
+ public static decimal? Max(
+ this IEnumerable<decimal?> source)
+ {
+ CheckNotNull(source, "source");
+
+ return MinMaxImpl(source.Where(x => x != null),
+ null, (max, x) => x == null || (max != null && x.Value <
max.Value));
+ }
+
+ /// <summary>
+ /// Invokes a transform function on each element of a sequence and
+ /// returns the maximum nullable <see cref="System.Decimal" />
value.
+ /// </summary>
+
+ public static decimal? Max<TSource>(
+ this IEnumerable<TSource> source,
+ Func<TSource, decimal?> selector)
+ {
+ return source.Select(selector).Max();
+ }
+ }
+}
=======================================
--- /dev/null
+++ /src/
Enumerable.g.tt Sat Apr 30 05:48:09 2011
@@ -0,0 +1,214 @@
+<#@ Template Language="C#" #>
+<#@ Import Namespace="System.CodeDom" #>
+<#@ Import Namespace="System.CodeDom.Compiler" #>
+<#@ Import Namespace="Microsoft.CSharp" #>
+<#
+ Type[] types = new Type[]
+ {
+ typeof(int),
+ typeof(int?),
+ typeof(long),
+ typeof(long?),
+ typeof(float),
+ typeof(float?),
+ typeof(double),
+ typeof(double?),
+ typeof(decimal),
+ typeof(decimal?),
+ };
+#>
+#region License, Terms and Author(s)
+//
+// LINQBridge
+// Copyright (c) 2007-9 Atif Aziz, Joseph Albahari. All rights reserved.
+//
+// Author(s):
+//
+// Atif Aziz,
http://www.raboof.com
+//
+// This library is free software; you can redistribute it and/or modify it
+// under the terms of the New BSD License, a copy of which should have
+// been delivered along with this distribution.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+#endregion
+
+// $Id:
Enumerable.g.tt 215 2009-10-03 13:31:49Z azizatif $
+
+namespace System.Linq
+{
+ #region Imports
+
+ using System;
+ using System.Collections.Generic;
+
+ #endregion
+
+ // This partial implementation was template-generated:
+ // <#= DateTime.UtcNow.ToString("r",
System.Globalization.CultureInfo.InvariantCulture) #>
+
+ partial class Enumerable
+ {<#
+
+ CodeDomProvider cscp = new CSharpCodeProvider();
+ foreach (Type type in types)
+ {
+ bool isNullable = type.IsGenericType && typeof(Nullable<>) ==
type.GetGenericTypeDefinition();
+ string csBaseType, csType, doc;
+ Type baseType;
+
+ if (isNullable)
+ {
+ baseType = type.GetGenericArguments()[0];
+ csBaseType = cscp.GetTypeOutput(new
CodeTypeReference(baseType));
+ csType = csBaseType + "?";
+ doc = string.Empty;
+ }
+ else
+ {
+ baseType = type;
+ csBaseType = csType = cscp.GetTypeOutput(new
CodeTypeReference(type));
+ doc = "nullable ";
+ }
+
+ doc += "<see cref=\"" + baseType + "\" />";
+#>
+
+ /// <summary>
+ /// Computes the sum of a sequence of <#= doc #> values.
+ /// </summary>
+
+ public static <#= csType #> Sum(
+ this IEnumerable<<#= csType #>> source)
+ {
+ CheckNotNull(source, "source");
+
+ <#= csBaseType #> sum = 0;
+ foreach (var num in source)
+ sum = checked(sum + <#= isNullable ? "(num ?? 0)" : "num"
#>);
+
+ return sum;
+ }
+
+ /// <summary>
+ /// Computes the sum of a sequence of <#= doc #>
+ /// values that are obtained by invoking a transform function on
+ /// each element of the input sequence.
+ /// </summary>
+
+ public static <#= csType #> Sum<TSource>(
+ this IEnumerable<TSource> source,
+ Func<TSource, <#= csType #>> selector)
+ {
+ return source.Select(selector).Sum();
+ }
+<#
+ string csSumType = type == typeof(int) || type == typeof(long) ||
type == typeof(int?) || type == typeof(long?)
+ ? "long" : csBaseType;
+ string csAvgType = (type == typeof(int) || type == typeof(long) ||
type == typeof(int?) || type == typeof(long?)
+ ? "double" : csBaseType) + (isNullable ? "?" :
string.Empty);
+#>
+ /// <summary>
+ /// Computes the average of a sequence of <#= doc #> values.
+ /// </summary>
+
+ public static <#= csAvgType #> Average(
+ this IEnumerable<<#= csType #>> source)
+ {
+ CheckNotNull(source, "source");
+
+ <#= csSumType #> sum = 0;
+ long count = 0;
+
+ foreach (var num in source<# if (isNullable) { #>.Where(n =>
n != null)<# } #>)
+ checked
+ {
+ sum += (<#= csBaseType #>) num;
+ count++;
+ }
+
+ if (count == 0)
+ <# if (isNullable) { #>return null<# } else { #>throw new
InvalidOperationException()<# } #>;
+
+ return (<#= csAvgType #>) sum / count;
+ }
+
+ /// <summary>
+ /// Computes the average of a sequence of <#= doc #> values
+ /// that are obtained by invoking a transform function on each
+ /// element of the input sequence.
+ /// </summary>
+
+ public static <#= csAvgType #> Average<TSource>(
+ this IEnumerable<TSource> source,
+ Func<TSource, <#= csType #>> selector)
+ {
+ return source.Select(selector).Average();
+ }
+
+<# if (isNullable) { #>
+ /// <summary>
+ /// Returns the minimum value in a sequence of nullable
+ /// <#= doc #> values.
+ /// </summary>
+
+ public static <#= csType #> Min(
+ this IEnumerable<<#= csType #>> source)
+ {
+ CheckNotNull(source, "source");
+
+ return MinMaxImpl(source.Where(x => x != null), null, (min, x)
=> min < x);
+ }
+
+ /// <summary>
+ /// Invokes a transform function on each element of a sequence and
+ /// returns the minimum nullable <#= doc #> value.
+ /// </summary>
+
+ public static <#= csType #> Min<TSource>(
+ this IEnumerable<TSource> source,
+ Func<TSource, <#= csType #>> selector)
+ {
+ return source.Select(selector).Min();
+ }
+
+ /// <summary>
+ /// Returns the maximum value in a sequence of nullable
+ /// <#= doc #> values.
+ /// </summary>
+
+ public static <#= csType #> Max(
+ this IEnumerable<<#= csType #>> source)
+ {
+ CheckNotNull(source, "source");
+
+ return MinMaxImpl(source.Where(x => x != null),
+ null, (max, x) => x == null || (max != null && x.Value <
max.Value));
+ }
+
+ /// <summary>
+ /// Invokes a transform function on each element of a sequence and
+ /// returns the maximum nullable <#= doc #> value.
+ /// </summary>
+
+ public static <#= csType #> Max<TSource>(
+ this IEnumerable<TSource> source,
+ Func<TSource, <#= csType #>> selector)
+ {
+ return source.Select(selector).Max();
+ }
+<# } #>
+<# } #>
+ }
+}
=======================================
--- /dev/null
+++ /src/ExtensionAttribute.cs Sat Apr 30 05:48:09 2011
@@ -0,0 +1,41 @@
+#region License, Terms and Author(s)
+//
+// LINQBridge
+// Copyright (c) 2007-9 Atif Aziz, Joseph Albahari. All rights reserved.
+//
+// Author(s):
+//
+// Atif Aziz,
http://www.raboof.com
+//
+// This library is free software; you can redistribute it and/or modify it
+// under the terms of the New BSD License, a copy of which should have
+// been delivered along with this distribution.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+#endregion
+
+namespace System.Runtime.CompilerServices
+{
+ /// <remarks>
+ /// This attribute allows us to define extension methods without
+ /// requiring .NET Framework 3.5. For more information, see the
section,
+ /// <a
href="
http://msdn.microsoft.com/en-us/magazine/cc163317.aspx#S7">Extension
Methods in .NET Framework 2.0 Apps</a>,
+ /// of <a
href="
http://msdn.microsoft.com/en-us/magazine/cc163317.aspx">Basic
Instincts: Extension Methods</a>
+ /// column in <a href="
http://msdn.microsoft.com/msdnmag/">MSDN
Magazine</a>,
+ /// issue <a
href="
http://msdn.microsoft.com/en-us/magazine/cc135410.aspx">Nov 2007</a>.
+ /// </remarks>
+
+ [AttributeUsage(AttributeTargets.Method | AttributeTargets.Class |
AttributeTargets.Assembly)]
+ public sealed class ExtensionAttribute : Attribute { }
+}
=======================================
--- /dev/null
+++ /src/Func.cs Sat Apr 30 05:48:09 2011
@@ -0,0 +1,45 @@
+#region License, Terms and Author(s)
+//
+// LINQBridge
+// Copyright (c) 2007-9 Atif Aziz, Joseph Albahari. All rights reserved.
+//
+// Author(s):
+//
+// Atif Aziz,
http://www.raboof.com
+//
+// This library is free software; you can redistribute it and/or modify it
+// under the terms of the New BSD License, a copy of which should have
+// been delivered along with this distribution.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+#endregion
+
+// $Id: Func.cs 224 2009-10-04 07:13:08Z azizatif $
+
+namespace System
+{
+#if LINQBRIDGE_LIB
+ public delegate TResult Func<TResult>();
+ public delegate TResult Func<T, TResult>(T a);
+ public delegate TResult Func<T1, T2, TResult>(T1 arg1, T2 arg2);
+ public delegate TResult Func<T1, T2, T3, TResult>(T1 arg1, T2 arg2, T3
arg3);
+ public delegate TResult Func<T1, T2, T3, T4, TResult>(T1 arg1, T2
arg2, T3 arg3, T4 arg4);
+#else
+ delegate TResult Func<TResult>();
+ delegate TResult Func<T, TResult>(T a);
+ delegate TResult Func<T1, T2, TResult>(T1 arg1, T2 arg2);
+ delegate TResult Func<T1, T2, T3, TResult>(T1 arg1, T2 arg2, T3 arg3);
+ delegate TResult Func<T1, T2, T3, T4, TResult>(T1 arg1, T2 arg2, T3
arg3, T4 arg4);
+#endif
+}
=======================================
--- /dev/null
+++ /src/IGrouping.cs Sat Apr 30 05:48:09 2011
@@ -0,0 +1,50 @@
+#region License, Terms and Author(s)
+//
+// LINQBridge
+// Copyright (c) 2007-9 Atif Aziz, Joseph Albahari. All rights reserved.
+//
+// Author(s):
+//
+// Atif Aziz,
http://www.raboof.com
+//
+// This library is free software; you can redistribute it and/or modify it
+// under the terms of the New BSD License, a copy of which should have
+// been delivered along with this distribution.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+#endregion
+
+// $Id: IGrouping.cs 225 2009-10-04 07:16:14Z azizatif $
+
+namespace System.Linq
+{
+ #region Imports
+
+ using System.Collections.Generic;
+
+ #endregion
+
+ /// <summary>
+ /// Represents a collection of objects that have a common key.
+ /// </summary>
+
+ partial interface IGrouping<TKey, TElement> : IEnumerable<TElement>
+ {
+ /// <summary>
+ /// Gets the key of the <see cref="IGrouping{TKey,TElement}" />.
+ /// </summary>
+
+ TKey Key { get; }
+ }
+}
=======================================
--- /dev/null
+++ /src/ILookup.cs Sat Apr 30 05:48:09 2011
@@ -0,0 +1,46 @@
+#region License, Terms and Author(s)
+//
+// LINQBridge
+// Copyright (c) 2007-9 Atif Aziz, Joseph Albahari. All rights reserved.
+//
+// Author(s):
+//
+// Atif Aziz,
http://www.raboof.com
+//
+// This library is free software; you can redistribute it and/or modify it
+// under the terms of the New BSD License, a copy of which should have
+// been delivered along with this distribution.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+#endregion
+
+// $Id: ILookup.cs 224 2009-10-04 07:13:08Z azizatif $
+
+namespace System.Linq
+{
+ using System.Collections.Generic;
+
+ /// <summary>
+ /// Defines an indexer, size property, and Boolean search method for
+ /// data structures that map keys to <see cref="IEnumerable{T}"/>
+ /// sequences of values.
+ /// </summary>
+
+ partial interface ILookup<TKey, TElement> :
IEnumerable<IGrouping<TKey, TElement>>
+ {
+ bool Contains(TKey key);
+ int Count { get; }
+ IEnumerable<TElement> this[TKey key] { get; }
+ }
+}
=======================================
--- /dev/null
+++ /src/IOrderedEnumerable.cs Sat Apr 30 05:48:09 2011
@@ -0,0 +1,48 @@
+#region License, Terms and Author(s)
+//
+// LINQBridge
+// Copyright (c) 2007-9 Atif Aziz, Joseph Albahari. All rights reserved.
+//
+// Author(s):
+//
+// Atif Aziz,
http://www.raboof.com
+//
+// This library is free software; you can redistribute it and/or modify it
+// under the terms of the New BSD License, a copy of which should have
+// been delivered along with this distribution.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+#endregion
+
+// $Id: IOrderedEnumerable.cs 224 2009-10-04 07:13:08Z azizatif $
+
+namespace System.Linq
+{
+ using System.Collections.Generic;
+
+ /// <summary>
+ /// Represents a sorted sequence.
+ /// </summary>
+
+ partial interface IOrderedEnumerable<TElement> : IEnumerable<TElement>
+ {
+ /// <summary>
+ /// Performs a subsequent ordering on the elements of an
+ /// <see cref="IOrderedEnumerable{T}"/> according to a key.
+ /// </summary>
+
+ IOrderedEnumerable<TElement> CreateOrderedEnumerable<TKey>(
+ Func<TElement, TKey> keySelector, IComparer<TKey> comparer,
bool descending);
+ }
+}
=======================================
--- /dev/null
+++ /src/LINQBridge.csproj Sat Apr 30 05:48:09 2011
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="3.5" DefaultTargets="Build"
xmlns="
http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)'
== '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>9.0.30729</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{66621034-90CC-4D1A-B49E-73A13E3B22EF}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>LinqBridge</RootNamespace>
+ <AssemblyName>LinqBridge</AssemblyName>
+ <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
+ <FileAlignment>512</FileAlignment>
+ <SignAssembly>true</SignAssembly>
+ <AssemblyOriginatorKeyFile>LinqBridge.snk</AssemblyOriginatorKeyFile>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|
AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>..\bin\Debug\</OutputPath>
+ <DefineConstants>TRACE;DEBUG;LINQBRIDGE_LIB</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|
AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>..\bin\Release\</OutputPath>
+ <DefineConstants>TRACE;LINQBRIDGE_LIB</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="System" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="Action.cs" />
+ <Compile Include="Enumerable.cs" />
+ <Compile Include="Enumerable.g.cs">
+ <AutoGen>True</AutoGen>
+ <DesignTime>True</DesignTime>
+ <DependentUpon>
Enumerable.g.tt</DependentUpon>
+ </Compile>
+ <Compile Include="ExtensionAttribute.cs" />
+ <Compile Include="Func.cs" />
+ <Compile Include="IGrouping.cs" />
+ <Compile Include="ILookup.cs" />
+ <Compile Include="IOrderedEnumerable.cs" />
+ <Compile Include="Lookup.cs" />
+ <Compile Include="OrderedEnumerable.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="Public.cs" />
+ <Compile Include="Tuple.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <Service Include="{B4F97281-0DBD-4835-9ED8-7DFB966E87FF}" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="
Enumerable.g.tt">
+ <Generator>TextTemplatingFileGenerator</Generator>
+ <LastGenOutput>Enumerable.g.cs</LastGenOutput>
+ </None>
+ <None Include="LinqBridge.snk" />
+ </ItemGroup>
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the
targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+</Project>
=======================================
--- /dev/null
+++ /src/LinqBridge.snk Sat Apr 30 05:48:09 2011
Binary file, no diff available.
=======================================
--- /dev/null
+++ /src/Lookup.cs Sat Apr 30 05:48:09 2011
@@ -0,0 +1,125 @@
+#region License, Terms and Author(s)
+//
+// LINQBridge
+// Copyright (c) 2007-9 Atif Aziz, Joseph Albahari. All rights reserved.
+//
+// Author(s):
+//
+// Atif Aziz,
http://www.raboof.com
+//
+// This library is free software; you can redistribute it and/or modify it
+// under the terms of the New BSD License, a copy of which should have
+// been delivered along with this distribution.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+#endregion
+
+// $Id: Lookup.cs 224 2009-10-04 07:13:08Z azizatif $
+
+namespace System.Linq
+{
+ #region Imports
+
+ using System;
+ using System.Collections;
+ using System.Collections.Generic;
+ using IEnumerable=System.Collections.IEnumerable;
+
+ #endregion
+
+ /// <summary>
+ /// Represents a collection of keys each mapped to one or more values.
+ /// </summary>
+
+ internal sealed class Lookup<TKey, TElement> : ILookup<TKey, TElement>
+ {
+ private readonly Dictionary<TKey, IGrouping<TKey, TElement>> _map;
+
+ internal Lookup(IEqualityComparer<TKey> comparer)
+ {
+ _map = new Dictionary<TKey, IGrouping<TKey,
TElement>>(comparer);
+ }
+
+ internal void Add(IGrouping<TKey, TElement> item)
+ {
+ _map.Add(item.Key, item);
+ }
+
+ internal IEnumerable<TElement> Find(TKey key)
+ {
+ IGrouping<TKey, TElement> grouping;
+ return _map.TryGetValue(key, out grouping) ? grouping : null;
+ }
+
+ /// <summary>
+ /// Gets the number of key/value collection pairs in the <see
cref="Lookup{TKey,TElement}" />.
+ /// </summary>
+
+ public int Count
+ {
+ get { return _map.Count; }
+ }
+
+ /// <summary>
+ /// Gets the collection of values indexed by the specified key.
+ /// </summary>
+
+ public IEnumerable<TElement> this[TKey key]
+ {
+ get
+ {
+ IGrouping<TKey, TElement> result;
+ return _map.TryGetValue(key, out result) ? result :
Enumerable.Empty<TElement>();
+ }
+ }
+
+ /// <summary>
+ /// Determines whether a specified key is in the <see
cref="Lookup{TKey,TElement}" />.
+ /// </summary>
+
+ public bool Contains(TKey key)
+ {
+ return _map.ContainsKey(key);
+ }
+
+ /// <summary>
+ /// Applies a transform function to each key and its associated
+ /// values and returns the results.
+ /// </summary>
+
+ public IEnumerable<TResult> ApplyResultSelector<TResult>(
+ Func<TKey, IEnumerable<TElement>, TResult> resultSelector)
+ {
+ if (resultSelector == null)
+ throw new ArgumentNullException("resultSelector");
+
+ foreach (var pair in _map)
+ yield return resultSelector(pair.Key, pair.Value);
+ }
+
+ /// <summary>
+ /// Returns a generic enumerator that iterates through the <see
cref="Lookup{TKey,TElement}" />.
+ /// </summary>
+
+ public IEnumerator<IGrouping<TKey, TElement>> GetEnumerator()
+ {
+ return _map.Values.GetEnumerator();
+ }
+
+ IEnumerator IEnumerable.GetEnumerator()
+ {
+ return GetEnumerator();
+ }
+ }
+}
=======================================
--- /dev/null
+++ /src/OrderedEnumerable.cs Sat Apr 30 05:48:09 2011
@@ -0,0 +1,142 @@
+#region License, Terms and Author(s)
+//
+// LINQBridge
+// Copyright (c) 2007-9 Atif Aziz, Joseph Albahari. All rights reserved.
+//
+// Author(s):
+//
+// Atif Aziz,
http://www.raboof.com
+//
+// This library is free software; you can redistribute it and/or modify it
+// under the terms of the New BSD License, a copy of which should have
+// been delivered along with this distribution.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+#endregion
+
+// $Id: OrderedEnumerable.cs 237 2010-01-31 12:20:24Z azizatif $
+
+namespace LinqBridge
+{
+ #region Imports
+
+ using System;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ #endregion
+
+ internal sealed class OrderedEnumerable<T, K> : IOrderedEnumerable<T>
+ {
+ private readonly IEnumerable<T> _source;
+ private readonly List<Comparison<T>> _comparisons;
+
+ public OrderedEnumerable(IEnumerable<T> source,
+ Func<T, K> keySelector, IComparer<K> comparer, bool
descending) :
+ this(source, null, keySelector, comparer, descending) {}
+
+ private OrderedEnumerable(IEnumerable<T> source,
List<Comparison<T>> comparisons,
+ Func<T, K> keySelector, IComparer<K> comparer, bool descending)
+ {
+ if (source == null) throw new ArgumentNullException("source");
+ if (keySelector == null) throw new
ArgumentNullException("keySelector");
+
+ _source = source;
+
+ comparer = comparer ?? Comparer<K>.Default;
+
+ if (comparisons == null)
+ comparisons = new List<Comparison<T>>(/* capacity */ 4);
+
+ comparisons.Add((x, y)
+ => (descending ? -1 : 1) *
comparer.Compare(keySelector(x), keySelector(y)));
+
+ _comparisons = comparisons;
+ }
+
+ public IOrderedEnumerable<T> CreateOrderedEnumerable<KK>(
+ Func<T, KK> keySelector, IComparer<KK> comparer, bool
descending)
+ {
+ return new OrderedEnumerable<T, KK>(_source, _comparisons,
keySelector, comparer, descending);
+ }
+
+ public IEnumerator<T> GetEnumerator()
+ {
+ //
+ // We sort using List<T>.Sort, but docs say that it performs an
+ // unstable sort. LINQ, on the other hand, says OrderBy
performs
+ // a stable sort. So convert the source sequence into a
sequence
+ // of tuples where the second element tags the position of the
+ // element from the source sequence (First). The position is
+ // then used as a tie breaker when all keys compare equal,
+ // thus making the sort stable.
+ //
+
+ var list = _source.Select(new Func<T, int, Tuple<T,
int>>(TagPosition)).ToList();
+
+ list.Sort((x, y) =>
+ {
+ //
+ // Compare keys from left to right.
+ //
+
+ var comparisons = _comparisons;
+ for (var i = 0; i < comparisons.Count; i++)
+ {
+ var result = comparisons[i](x.First, y.First);
+ if (result != 0)
+ return result;
+ }
+
+ //
+ // All keys compared equal so now break the tie by their
+ // position in the original sequence, making the sort
stable.
+ //
+
+ return x.Second.CompareTo(y.Second);
+ });
+
+ return list.Select(new Func<Tuple<T, int>,
T>(GetFirst)).GetEnumerator();
+
+ }
+
+ /// <remarks>
+ /// See <a
href="
http://code.google.com/p/linqbridge/issues/detail?id=11">issue #11</a>
+ /// for why this method is needed and cannot be expressed as a
+ /// lambda at the call site.
+ /// </remarks>
+
+ private static Tuple<T, int> TagPosition(T e, int i)
+ {
+ return new Tuple<T, int>(e, i);
+ }
+
+ /// <remarks>
+ /// See <a
href="
http://code.google.com/p/linqbridge/issues/detail?id=11">issue #11</a>
+ /// for why this method is needed and cannot be expressed as a
+ /// lambda at the call site.
+ /// </remarks>
+
+ private static T GetFirst(Tuple<T, int> pv)
+ {
+ return pv.First;
+ }
+
+ IEnumerator IEnumerable.GetEnumerator()
+ {
+ return GetEnumerator();
+ }
+ }
+}
=======================================
--- /dev/null
+++ /src/Properties/AssemblyInfo.cs Sat Apr 30 05:48:09 2011
@@ -0,0 +1,54 @@
+#region License, Terms and Author(s)
+//
+// LINQBridge
+// Copyright (c) 2007-9 Atif Aziz, Joseph Albahari. All rights reserved.
+//
+// Author(s):
+//
+// Atif Aziz,
http://www.raboof.com
+//
+// This library is free software; you can redistribute it and/or modify it
+// under the terms of the New BSD License, a copy of which should have
+// been delivered along with this distribution.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+#endregion
+
+using System;
+using System.Reflection;
+using System.Runtime.InteropServices;
+using System.Security;
+
+[assembly: AssemblyTitle("LINQBridge")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("LINQBridge")]
+[assembly: AssemblyCopyright("Copyright (c) 2007-9, Atif Aziz, Joseph
Albahari. All rights reserved.")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+#if DEBUG
+[assembly: AssemblyConfiguration("DEBUG")]
+#else
+[assembly: AssemblyConfiguration("RELEASE")]
+#endif
+
+[assembly: ComVisible(false)]
+[assembly: CLSCompliant(true)]
+[assembly: AllowPartiallyTrustedCallers]
+
+[assembly: Guid("1d8ca19d-f7ef-47f2-8144-4099aab2b2b7")]
+
+[assembly: AssemblyVersion("1.2.0.0")]
+[assembly: AssemblyFileVersion("1.2.13016.2208")]
=======================================
--- /dev/null
+++ /src/Public.cs Sat Apr 30 05:48:09 2011
@@ -0,0 +1,40 @@
+#region License, Terms and Author(s)
+//
+// LINQBridge
+// Copyright (c) 2007-9 Atif Aziz, Joseph Albahari. All rights reserved.
+//
+// Author(s):
+//
+// Atif Aziz,
http://www.raboof.com
+//
+// This library is free software; you can redistribute it and/or modify it
+// under the terms of the New BSD License, a copy of which should have
+// been delivered along with this distribution.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+#endregion
+
+// $Id: Public.cs 224 2009-10-04 07:13:08Z azizatif $
+
+namespace System.Linq
+{
+#if LINQBRIDGE_LIB
+
+ public partial class Enumerable { }
+ public partial interface IGrouping<TKey, TElement> { }
+ public partial interface ILookup<TKey, TElement> { }
+ public partial interface IOrderedEnumerable<TElement> { }
+
+#endif
+}
=======================================
--- /dev/null
+++ /src/Tuple.cs Sat Apr 30 05:48:09 2011
@@ -0,0 +1,77 @@
+#region License, Terms and Author(s)
+//
+// LINQBridge
+// Copyright (c) 2007-9 Atif Aziz, Joseph Albahari. All rights reserved.
+//
+// Author(s):
+//
+// Atif Aziz,
http://www.raboof.com
+//
+// This library is free software; you can redistribute it and/or modify it
+// under the terms of the New BSD License, a copy of which should have
+// been delivered along with this distribution.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+#endregion
+
+// $Id: Tuple.cs 215 2009-10-03 13:31:49Z azizatif $
+
+namespace LinqBridge
+{
+ #region Imports
+
+ using System;
+ using System.Collections.Generic;
+ using System.Text;
+
+ #endregion
+
+ [ Serializable ]
+ internal struct Tuple<TFirst, TSecond> : IEquatable<Tuple<TFirst,
TSecond>>
+ {
+ public TFirst First { get; private set; }
+ public TSecond Second { get; private set; }
+
+ public Tuple(TFirst first, TSecond second) : this()
+ {
+ First = first;
+ Second = second;
+ }
+
+ public override bool Equals(object obj)
+ {
+ return obj != null
+ && obj is Tuple<TFirst, TSecond>
+ && base.Equals((Tuple<TFirst, TSecond>) obj);
+ }
+
+ public bool Equals(Tuple<TFirst, TSecond> other)
+ {
+ return EqualityComparer<TFirst>.Default.Equals(other.First,
First)
+ &&
EqualityComparer<TSecond>.Default.Equals(other.Second, Second);
+ }
+
+ public override int GetHashCode()
+ {
+ var num = 0x7a2f0b42;
+ num = (-1521134295 * num) +
EqualityComparer<TFirst>.Default.GetHashCode(First);
+ return (-1521134295 * num) +
EqualityComparer<TSecond>.Default.GetHashCode(Second);
+ }
+
+ public override string ToString()
+ {
+ return string.Format(@"{{ First = {0}, Second = {1} }}",
First, Second);
+ }
+ }
+}
=======================================
--- /dev/null
+++ /test/LINQ.Tests/LINQ.Tests.csproj Sat Apr 30 05:48:09 2011
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="3.5" DefaultTargets="Build"
xmlns="
http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)'
== '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>9.0.30729</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{FF0FB762-A5DB-4AF2-A917-BD185E97F90B}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>Linq.Tests</RootNamespace>
+ <AssemblyName>Linq.Tests</AssemblyName>
+ <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+ <FileAlignment>512</FileAlignment>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|
AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <NoWarn>1685</NoWarn>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="nunit.framework, Version=2.4.8.0, Culture=neutral,
PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\..\tools\NUnit\nunit.framework.dll</HintPath>
+ </Reference>
+ <Reference Include="System" />
+ <Reference Include="System.Core">
+ <RequiredTargetFramework>3.5</RequiredTargetFramework>
+ </Reference>
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="..\LINQBridge.Tests\EnumerableFixture.cs">
+ <Link>EnumerableFixture.cs</Link>
+ </Compile>
+ <Compile Include="..\LINQBridge.Tests\Reader.cs">
+ <Link>Reader.cs</Link>
+ </Compile>
+ <Compile Include="..\LINQBridge.Tests\Tester.cs">
+ <Link>Tester.cs</Link>
+ </Compile>
+ </ItemGroup>
+ <ItemGroup>
+ <Folder Include="Properties\" />
+ </ItemGroup>
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the
targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+</Project>
=======================================
--- /dev/null
+++ /test/LINQBridge.Tests/EnumerableFixture.cs Sat Apr 30 05:48:09 2011
@@ -0,0 +1,2233 @@
+#region License, Terms and Author(s)
+//
+// LINQBridge
+// Copyright (c) 2007-9 Atif Aziz, Joseph Albahari. All rights reserved.
+//
+// Author(s):
+//
+// Dominik Hug,
http://www.dominikhug.ch
+// Atif Aziz,
http://www.raboof.com
+//
+// This library is free software; you can redistribute it and/or modify it
+// under the terms of the New BSD License, a copy of which should have
+// been delivered along with this distribution.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+#endregion
+
+namespace LinqBridge.Tests
+{
+ #region Imports
+
+ using System;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Globalization;
+ using System.Text;
+ using NUnit.Framework;
+ using System.Linq;
+ using NUnit.Framework.SyntaxHelpers;
+ using System.Diagnostics;
+
+ #endregion
+
+ [TestFixture]
+ public sealed class EnumerableFixture
+ {
+ private CultureInfo initialCulture; // Thread culture saved during
Setup to be undone in TearDown.
+ private AssertionHandler tearDownAssertions;
+
+ private delegate void AssertionHandler();
+
+ [SetUp]
+ public void SetUp()
+ {
+ tearDownAssertions = null;
+ initialCulture =
System.Threading.Thread.CurrentThread.CurrentCulture;
+ System.Threading.Thread.CurrentThread.CurrentCulture = new
CultureInfo("de-CH");
+ }
+
+ [TearDown]
+ public void TearDown()
+ {
+ if (tearDownAssertions != null)
+ tearDownAssertions();
+ System.Threading.Thread.CurrentThread.CurrentCulture =
initialCulture;
+ }
+
+ [Test]
+ [ExpectedException(typeof(InvalidOperationException))]
+ public void Aggregate_EmptySource_ThrowsInvalidOperationException()
+ {
+ var source = Read<object>();
+ source.Aggregate(delegate { throw new
NotImplementedException(); });
+ }
+
+ [Test]
+ public void Aggregate_AddFuncOnIntegers_ReturnsTotal()
+ {
+ var source = Read(12, 34, 56, 78, 910, 1112, 1314, 1516, 1718,
1920);
+ var result = source.Aggregate((a, b) => a + b);
+ Assert.That(result, Is.EqualTo(8670));
+ }
+
+ [Test]
+ public void Aggregate_AddFuncOnIntegersWithSeed_ReturnsTotal()
+ {
+ var source = Read(12, 34, 56, 78, 910, 1112, 1314, 1516, 1718,
1920);
+ var result = source.Aggregate(100, (a, b) => a + b);
+ Assert.That(result, Is.EqualTo(8770));
+ }
+
+ [Test]
+ [ExpectedException(typeof(ArgumentNullException))]
+ public void Aggregate_NullSource_ThrowsArgumentNullException()
+ {
+ Enumerable.Aggregate<object>(null, delegate { throw new
NotImplementedException(); });
+ }
+
+ [Test]
+ [ExpectedException(typeof(ArgumentNullException))]
+ public void Aggregate_NullFunc_ThrowsArgumentNullException()
+ {
+ Read<object>().Aggregate(null);
+ }
+
+ [Test]
+ public void Empty_YieldsEmptySource()
+ {
+ var source = Enumerable.Empty<string>();
+ Assert.That(source, Is.Not.Null);
+ var e = source.GetEnumerator();
+ Assert.That(e, Is.Not.Null);
+ Assert.That(e.MoveNext(), Is.False);
+ }
+
+ [Test]
+ [ExpectedException(typeof(ArgumentNullException))]
+ public void Cast_NullSource_ThrowsArgumentNullException()
+ {
+ Enumerable.Cast<object>(null);
+ }
+
+ [Test]
+ [ExpectedException(typeof(InvalidCastException))]
+ public void Cast_InvalidSource_ThrowsInvalidCastException()
+ {
+ var source = Read(1000, "hello", new object());
+ var e = source.Cast<byte>().GetEnumerator();
+ e.MoveNext(); // Do something so Cast will really run
(deferred execution)
+ }
+
+ [Test]
+ public void
Cast_ObjectSourceContainingIntegers_YieldsDowncastedIntegers()
+ {
+ var source = Read<object>(1, 10, 100);
+ source.Cast<int>().AssertEquals(1, 10, 100);
+ }
+
+ [Test]
+ public void Cast_Integers_YieldsUpcastedObjects()
+ {
+ Read(1, 10, 100).Cast<object>().AssertEquals(1, 10, 100);
+ }
+
+ [Test]
+ [ExpectedException(typeof(ArgumentNullException))]
+ public void All_NullSource_ThrowsArgumentNullException()
+ {
+ Enumerable.All(null, (int i) => { throw new
NotImplementedException(); });
+ }
+
+ [Test]
+ public void
All_SomeSourceElementsNotSatifyingPredicate_ReturnsFalse()
+ {
+ var source = Read(-100, -1, 0, 1, 100);
+ Assert.That(source.All(i => i < 0), Is.False);
+ }
+
+ [Test]
+ public void All_SourceElementsSatisfyingPredicate_ReturnsTrue()
+ {
+ var source = Read(-100, -1, 0, 1, 100);
+ Assert.That(source.All(i => i >= -100), Is.True);
+ }
+
+ [Test]
+ [ExpectedException(typeof(ArgumentNullException))]
+ public void Any_NullSource_ThrowsArgumentNullException()
+ {
+ Enumerable.Any<object>(null);
+ }
+
+ [Test]
+ public void Any_EmptySource_ReturnsFalse()
+ {
+ var source = Read<object>();
+ Assert.That(source.Any(), Is.False);
+ }
+
+ [Test]
+ public void Any_NonEmptySource_ReturnsTrue()
+ {
+ var source = Read(new object());
+ Assert.That(source.Any(), Is.True);
+ }
+
+ [Test]
+ public void Any_PredicateArg_EmptySource_ReturnsFalse()
+ {
+ var source = Read(new int[0]);
+ Assert.That(source.Any(delegate { throw new
NotImplementedException(); }), Is.False);
+ }
+
+ [Test]
+ public void Any_PredicateArg_NonEmptySource_ReturnsTrue()
+ {
+ Assert.That(Read(1, 2, 3, 4, 5).Any(i => i > 2), Is.True);
+ }
+
+ [Test]
+ [ExpectedException(typeof(InvalidOperationException))]
+ public void
Average_EmptyLongSource_ThrowsInvalidOperationException()
+ {
+ Read<long>().Average();
+ }
+
+ [Test]
+ public void Average_Longs_ReturnsAverage()
+ {
+ Assert.That(Read(25L, 75L).Average(), Is.EqualTo(50));
+ }
+
+ [Test]
+ public void Average_SelectorArg_Longs_ReturnsAverage()
+ {
+ Assert.That(Read(25L, 75L).Average(n => n * 2L),
Is.EqualTo(100));
+ }
+
+ [Test]
+ public void Average_EmptyNullableLongSource_Null()
+ {
+ Assert.That(Read<long?>().Average(), Is.Null);
+ }
+
+ [Test]
+ public void Average_NullableLongsWithSomeNull_ReturnsAverage()
+ {
+ Assert.That(Read<long?>(12L, null, 34L, null, 56L).Average(),
Is.EqualTo(34.0));
+ }
+
+ [Test]
+ public void
Average_SelectorArg_NullableLongsWithSomeNull_ReturnsAverage()
+ {
+ Assert.That(Read<long?>(12L, null, 34L, null, 56L).Average(n
=> n * 2L), Is.EqualTo(68.0));
+ }
+
+ [Test]
+ public void Average_EmptyNullableIntegerSource_Null()
+ {
+ Assert.That(Read<int?>().Average(), Is.Null);
+ }
+
+ [Test]
+ public void Average_NullableIntegersWithSomeNull_ReturnsAverage()
+ {
+ Assert.That(Read<int?>(12, null, 34, null, 56).Average(),
Is.EqualTo(34.0));
+ }
+
+ [Test]
+ public void
Average_SelectorArg_NullableIntegersWithSomeNull_ReturnsAverage()
+ {
+ Assert.That(Read<int?>(12, null, 34, null, 56).Average(n => n
* 2), Is.EqualTo(68.0));
+ }
+
+ [Test]
+ [ExpectedException(typeof(InvalidOperationException))]
+ public void
Average_EmptyDecimalSource_ThrowsInvalidOperationException()
+ {
+ Read<decimal>().Average();
+ }
+
+ [Test]
+ public void Average_Decimals_ReturnsAverage()
+ {
+ var source = Read(-10000m, 2.0001m, 50m);
+ Assert.That(source.Average(),
Is.EqualTo(-3315.999966).Within(0.00001));
+ }
+
+ [Test]
+ public void Average_SelectorArg_Decimals_ReturnsAverage()
+ {
+ var source = Read(-10000m, 2.0001m, 50m);
+ Assert.That(source.Average(n => n * 2m),
Is.EqualTo(-6631.999933).Within(0.00001));
+ }
+
+ [Test]
+ [ExpectedException(typeof(InvalidOperationException))]
+ public void Average_EmptySource_ThrowsInvalidOperationException()
+ {
+ Read<int>().Average();
+ }
+
+ [Test]
+ public void Average_EmptyNullableIntegerSource_ReturnsNull()
+ {
+ Assert.That(Read<int?>().Average(), Is.Null);
+ }
+
+ [Test]
+ public void Average_SelectorArg_Integers_ReturnsAverage()
+ {
+ Assert.That(Read(21, 22, 23, 24).Average(n => n *
2).Equals(45));
+ }
+
+ [Test]
+ [ExpectedException(typeof(InvalidOperationException))]
+ public void
Average_EmptyDoubleSource_ThrowsInvalidOperationException()
+ {
+ Read<double>().Average();
+ }
+
+ [Test]
+ public void Average_Doubles_ReturnsAverage()
+ {
+ var source = Read(-3.45, 9.001, 10000.01);
+ Assert.That(source.Average(),
Is.EqualTo(3335.187).Within(0.01));
+ }
+
+ [Test]
+ public void Average_SelectorArg_Doubles_ReturnsAverage()
+ {
+ var source = Read(-3.45, 9.001, 10000.01);
+ Assert.That(source.Average(n => n * 2.0),
Is.EqualTo(6670.374).Within(0.01));
+ }
+
+ [Test]
+ [ExpectedException(typeof(InvalidOperationException))]
+ public void
Average_EmptyFloatSource_ThrowsInvalidOperationException()
+ {
+ Read<float>().Average();
+ }
+
+ [Test]
+ public void Average_Floats_ReturnsAverage()
+ {
+ var source = Read(-3.45F, 9.001F, 10000.01F);
+ Assert.That(source.Average(),
Is.EqualTo(3335.187).Within(0.01));
+ }
+
+ [Test]
+ public void Average_SelectorArg_Floats_ReturnsAverage()
+ {
+ var source = Read(-3.45F, 9.001F, 10000.01F);
+ Assert.That(source.Average(n => n * 2F),
Is.EqualTo(6670.37354).Within(0.01));
+ }
+
+ [Test]
+ public void Average_EmptyNullableFloatSource_Null()
+ {
+ Assert.That(Read<float?>().Average(), Is.Null);
+ }
+
+ [Test]
+ public void Average_NullableFloatsWithSomeNulls_ReturnsAverage()
+ {
+ var source = Read<float?>(-3.45F, null, 9.001F, null,
10000.01F);
+ Assert.That(source.Average(),
Is.EqualTo(3335.187).Within(0.01));
+ }
+
+ [Test]
+ public void
Average_SelectorArg_NullableFloatsWithSomeNulls_ReturnsAverage()
+ {
+ var source = Read<float?>(-3.45F, null, 9.001F, null,
10000.01F);
+ Assert.That(source.Average(n => n * 2F),
Is.EqualTo(6670.37354).Within(0.01));
+ }
+
+ [Test]
+ public void Average_EmptyNullableDoubleSource_Null()
+ {
+ Assert.That(Read<double?>().Average(), Is.Null);
+ }
+
+ [Test]
+ public void Average_NullableDoublesWithSomeNulls_ReturnsAverage()
+ {
+ var source = Read<double?>(-3.45, null, 9.001, null, 10000.01);
+ Assert.That(source.Average(),
Is.EqualTo(3335.187).Within(0.01));
+ }
+
+ [Test]
+ public void
Average_SelectorArg_NullableDoublesWithSomeNulls_ReturnsAverage()
+ {
+ var source = Read<double?>(-3.45, null, 9.001, null, 10000.01);
+ Assert.That(source.Average(n => n * 2.0),
Is.EqualTo(6670.374).Within(0.01));
+ }
+
+ [Test]
+ public void Average_EmptyNullableDecimalSource_Null()
+ {
+ Assert.That(Read<decimal?>().Average(), Is.Null);
+ }
+
+ [Test]
+ public void Average_NullableDecimalsWithSomeNulls_ReturnsAverage()
+ {
+ var source = Read<decimal?>(-3.45m, null, 9.001m, null,
10000.01m);
+ Assert.That(source.Average(),
Is.EqualTo(3335.187).Within(0.01));
+ }
+
+ [Test]
+ public void
Average_SelectorArg_NullableDecimalsWithSomeNulls_ReturnsAverage()
+ {
+ var source = Read<decimal?>(-3.45m, null, 9.001m, null,
10000.01m);
+ Assert.That(source.Average(n => n * 2m),
Is.EqualTo(6670.374m).Within(0.01));
+ }
+
+ [Test]
+ [ExpectedException(typeof(ArgumentNullException))]
+ public void Concat_FirstSourceNull_ThrowsArgumentNullException()
+ {
+ Enumerable.Concat(null, new object[0]);
+ }
+
+ [Test]
+ [ExpectedException(typeof(ArgumentNullException))]
+ public void Concat_SecondSourceNull_ThrowsArgumentNullException()
+ {
+ new object[0].Concat(null);
+ }
+
+ [Test]
+ public void
Concat_TwoSequences_CombinedSequenceWhereElementsOfSecondFollowFirst()
+ {
+ var first = Read(12, 34, 56);
+ var second = Read(78, 910, 1112);
+ first.Concat(second).AssertEquals(12, 34, 56, 78, 910, 1112);
+ }
+
+ [Test]
+ public void Contains_SequenceContainingSoughtValue_ReturnsTrue()
+ {
+ var source = Read(12, -15, 21);
+ Assert.That(source.Contains(21), Is.True);
+ }
+
+ [Test]
+ public void Contains_SequenceWithoutSoughtValue_ReturnsFalse()
+ {
+ var source = Read(-2, 4, 8);
+ Assert.That(source.Contains(9), Is.False);
+ }
+
+ [Test]
+ public void
Contains_CollectionOptimization_ReturnsTrueWithoutEnumerating()
+ {
+ var source = new NonEnumerableList<int>(new[] { 1, 2, 3 });
+
+ // IMPORTANT! Use the non-extension invocation style below
+ // to avoid calling List<T>.Contains instead of
+ // Enumerable.Contains.
+
+ Assert.That(Enumerable.Contains(source, 3), Is.True);
+ }
+
+ [Test]
+ public void Count_Integers_ReturnsNumberOfElements()
+ {
+ Assert.That(Read(12, 34, 56).Count(), Is.EqualTo(3));
+ }
+
+ [Test]
+ public void
Count_PredicateArg_Strings_CountsOnlyStringsWithEvenLength()
+ {
+ var source = Read("A", "AB", "ABC", "ABCD");
+ Assert.That(source.Count(s => s.Length % 2 == 0),
Is.EqualTo(2));
+ }
+
+ [Test]
+ public void DefaultIfEmpty_Integers_YieldsIntegersInOrder()
+ {
+ var source = Read(12, 34, 56);
+ source.DefaultIfEmpty(1).AssertEquals(12, 34, 56);
+ }
+
+ [Test]
+ public void DefaultIfEmpty_EmptyIntegerSequence_ReturnsZero()
+ {
+ var source = Read(new int[0]);
+ source.DefaultIfEmpty().AssertEquals(0);
+ }
+
+ [Test]
+ public void
DefaultIfEmpty_DefaultValueArg_EmptyIntegerSequenceAndNonZeroDefault_ReturnNonZeroDefault()
+ {
+ var source = Read(new int[0]);
+ source.DefaultIfEmpty(5).AssertEquals(5);
+ }
+
+ [Test]
+ public void
DefaultIfEmpty_DefaultValueArg_Integers_YieldsIntegersInOrder()
+ {
+ var source = Read(12, 34, 56);
+ source.DefaultIfEmpty(5).AssertEquals(12, 34, 56);
+ }
+
+ [Test]
+ [ExpectedException(typeof(ArgumentNullException))]
+ public void Distinct_NullSource_ThrowsArgumentNullException()
+ {
+ Enumerable.Distinct<object>(null);
+ }
+
+ [Test]
+ public void
Distinct_IntegersWithSomeDuplicates_YieldsIntegersInSourceOrderWithoutDuplicates()
+ {
+ var source = Read(12, 34, 34, 56, 78, 78, 78, 910, 78);
+ source.Distinct().AssertEquals(12, 34, 56, 78, 910);
+ }
+
+ [Test]
+ public void
Distinct_MixedCaseStringsWithCaseIgnoringComparer_YieldsFirstCaseOfEachDistinctStringInSourceOrder()
+ {
+ var source = Read("Foo Bar BAZ BaR baz FOo".Split());
+
source.Distinct(StringComparer.InvariantCultureIgnoreCase).AssertEquals("Foo", "Bar", "BAZ");
+ }
+
+ [Test(Description = "See
http://code.google.com/p/linqbridge/issues/detail?id=13")]
+ public void Distinct_StringArrayWithOneNull_YieldsSet()
+ {
+ var set = new List<string> { null }.Distinct().GetEnumerator();
+ Assert.That(set.MoveNext(), Is.True);
+ Assert.That(set.Current, Is.Null);
+ Assert.That(set.MoveNext(), Is.False);
+ }
+
+ [Test]
+ [ExpectedException(typeof(ArgumentOutOfRangeException))]
+ public void
ElementAt_IndexOutOfRange_ThrowsArgumentOutOfRangeException()
+ {
+ var source = Read(3, 5, 7);
+ source.ElementAt(3);
+ }
+
+ [Test]
+ public void ElementAt_Integers_ReturnsValueAtGivenIndex()
+ {
+ var source = new[] { 15, 2, 7 };
+ Assert.That(Read(source).ElementAt(0), Is.EqualTo(15));
+ Assert.That(Read(source).ElementAt(1), Is.EqualTo(2));
+ Assert.That(Read(source).ElementAt(2), Is.EqualTo(7));
+ }
+
+ [Test]
+ [ExpectedException(typeof(ArgumentOutOfRangeException))]
+ public void
ElementAt_NegativeIndex_ThrowsArgumentOutOfRangeException()
+ {
+ Read<int>().ElementAt(-1);
+ }
+
+ [Test]
+ public void ElementAt_ListOptimization_ReturnsValueAtGivenIndex()
+ {
+ var source = new NonEnumerableList<int>(new[] { 1, 2, 3, 4, 5,
6 });
+ Assert.That(source.ElementAt(2), Is.EqualTo(3));
+ }
+
+ [Test]
+ public void
ElementAtOrDefault_IntegersWithOutOfRangeIndex_ReturnsDefault()
+ {
+ var source = Read(3, 6, 8);
+ Assert.That(source.ElementAtOrDefault(3), Is.EqualTo(0));
+ }
+
+ [Test]
+ public void ElementAtOrDefault_Integers_ReturnsValueAtGivenIndex()
+ {
+ var source = Read(3, 6, 9);
+ Assert.That(source.ElementAtOrDefault(2), Is.EqualTo(9));
+ }
+
+ [Test]
+ public void
ElementAtOrDefault_ListOptimization_ReturnsValueAtGivenIndex()
+ {
+ var source = new NonEnumerableList<int>(new[] {1, 2, 3, 4, 5,
6});
+ Assert.That(source.ElementAtOrDefault(2), Is.EqualTo(3));
+ }
+
+ [Test]
+ public void
ElementAtOrDefault_BooleansAndNegativeIndex_ReturnsDefault()
+ {
+ var source = Read(true, false, true, false);
+ Assert.That(source.ElementAtOrDefault(-3), Is.False);
+ }
+
+ [Test]
+ public void
ElementAtOrDefault_ObjectsWithOutOfRangeIndex_ReturnsNull()
+ {
+ var source = Read(new object(), new object());
+ Assert.That(source.ElementAtOrDefault(2), Is.EqualTo(null));
+ }
+
+ [Test]
+ public void ElementAtOrDefault_Objects_ReturnsValueAtGivenIndex()
+ {
+ var second = new object();
+ var source = Read(new object(), second, new object());
+ Assert.That(source.ElementAt(1), Is.EqualTo(second));
+ }
+
+ [Test]
+ [ExpectedException(typeof(ArgumentNullException))]
+ public void
Except_SecondArg_ArgumentNull_ThrowsArgumentNullException()
+ {
+ Read<object>().Except(null);
+ }
+
+ [Test]
+ public void Except_SecondArg_ValidArgument_ReturnsDifference()
+ {
+ var first = Read(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
+ var second = Read(1, 3, 5, 7, 9);
+ first.Except(second).AssertEquals(2, 4, 6, 8, 10);
+ }
+
+ [Test]
+ public void Except_SecondArgComparerArg_ComparerIsUsed()
+ {
+ var first = Read("albert", "john", "simon");
+ var second = Read("ALBERT");
+ first.Except(second,
StringComparer.CurrentCultureIgnoreCase).AssertEquals("john", "simon");
+ }
+
+ [Test]
+ [ExpectedException(typeof(InvalidOperationException))]
+ public void First_EmptySource_ThrowsInvalidOperationException()
+ {
+ Read<int>().First();
+ }
+
+ [Test]
+ public void First_Integers_ReturnsFirst()
+ {
+ var source = Read(12, 34, 56);
+ Assert.That(source.First(), Is.EqualTo(12));
+ }
+
+ [Test]
+ public void First_IntegersWithPredicateForEvens_FirstEvenInteger()
+ {
+ var source = Read(15, 20, 25, 30);
+ Assert.That(source.First(i => i % 2 == 0), Is.EqualTo(20));
+ }
+
+ [Test]
+ [ExpectedException(typeof(InvalidOperationException))]
+ public void
First_IntegerSequenceWithNoneMatchingPredicate_ThrowsInvalidOperationException()
+ {
+ var source = Read(12, 34, 56, 78);
+ Assert.That(source.First(i => i > 100), Is.EqualTo(0));
+ }
+
+ [Test]
+ public void FirstOrDefault_EmptyBooleanSource_ReturnsFalse()
+ {
+ Assert.That(Read<bool>().FirstOrDefault(), Is.False);
+ }
+
+ [Test]
+ public void FirstOrDefault_Objects_ReturnsFirstReference()
+ {
+ var first = new object();
+ var source = Read(first, new object());
+ Assert.That(source.FirstOrDefault(), Is.SameAs(first));
+ }
+
+ [Test]
+ [ExpectedException(typeof(ArgumentNullException))]
+ public void
FirstOrDefault_PredicateArg_NullPredicate_ThrowsArgumentNullException()
+ {
+ Read<int>().FirstOrDefault(null);
+ }
+
+ [Test]
+ public void
FirstOrDefault_PredicateArg_NonNullPredicate_ReturnsFirstMatchingItem()
+ {
+ var source = Read(1, 4, 8);
+ Assert.That(source.FirstOrDefault(i => i % 2 == 0),
Is.EqualTo(4));
+ }
+
+ [Test]
+ public void
FirstOrDefault_PredicateArg_IntegerSequenceWithNonMatchingPredicate_ReturnsDefaultValue()
+ {
+ var source = Read(1, 4, 6);
+ Assert.That(source.FirstOrDefault(i => i > 10), Is.EqualTo(0));
+ }
+
+ [Test]
+ public void
First_IntegerListOptimization_ReturnsFirstElementWithoutEnumerating()
+ {
+ var source = new NonEnumerableList<int>(new[] { 123, 456, 789
});
+ Assert.That(source.First(), Is.EqualTo(123));
+ }
+
+ private class Person
+ {
+ public string FirstName { get; set; }
+ public string LastName { get; set; }
+ public int Age { get; set; }
+
+ public static Person[] CreatePersons()
+ {
+ return new[]
+ {
+ new Person { LastName = "M\u00FCller", FirstName
= "Peter", Age = 21 },
+ new Person { LastName = "M\u00FCller", FirstName
= "Herbert", Age = 22 },
+ new Person { LastName = "Meier", FirstName
= "Hubert", Age = 23 },
+ new Person { LastName = "Meier", FirstName
= "Isidor", Age = 24 }
+ };
+ }
+
+ public static Person[] CreatePersonsWithNamesUsingMixedCase()
+ {
+ var persons = CreatePersons();
+ var herbert = persons[1];
+ herbert.LastName = herbert.LastName.ToLower();
+ var isidor = persons[3];
+ isidor.LastName = isidor.LastName.ToLower();
+ return persons;
+ }
+ }
+
+ [Test]
+ [ExpectedException(typeof(ArgumentNullException))]
+ public void
GroupBy_KeySelectorArg_NullAsKeySelector_ThrowsArgumentNullException()
+ {
+ Read<object>().GroupBy<object, object>(null);
+ }
+
+ [Test]
+ public void GroupBy_KeySelectorArg_ValidArguments_CorrectGrouping()
+ {
+ var persons = Read(Person.CreatePersons());
+ var result = new Reader<IGrouping<string,
Person>>(persons.GroupBy(person => person.LastName));
+
+ var group1 = result.Read();
+ Assert.That(group1.Key, Is.EqualTo("M\u00FCller"));
+ var muellers = new Reader<Person>(group1);
+ Assert.That(muellers.Read().FirstName, Is.EqualTo("Peter"));
+ Assert.That(muellers.Read().FirstName, Is.EqualTo("Herbert"));
+
+ var group2 = result.Read();
+ Assert.That(group2.Key, Is.EqualTo("Meier"));
+ var meiers = new Reader<Person>(group2);
+ Assert.That(meiers.Read().FirstName, Is.EqualTo("Hubert"));
+ Assert.That(meiers.Read().FirstName, Is.EqualTo("Isidor"));
+
+ result.AssertEnded();
+ }
+
+ [Test]
+ public void
GroupBy_KeySelectorArg_ValidArguments_CorrectCaseSensitiveGrouping()
+ {
+ var persons =
Read(Person.CreatePersonsWithNamesUsingMixedCase());
+
+ var result = persons.GroupBy(person => person.LastName);
+
+ var e = result.GetEnumerator();
+ Func<IGrouping<string, Person>, Person> first = g => new
Reader<Person>(g).Read();
+
+ e.MoveNext();
+ Assert.That(e.Current.Key, Is.EqualTo("M\u00FCller"));
+ Assert.That(first(e.Current).FirstName, Is.EqualTo("Peter"));
+
+ e.MoveNext();
+ Assert.That(e.Current.Key, Is.EqualTo("m\u00FCller"));
+ Assert.That(first(e.Current).FirstName, Is.EqualTo("Herbert"));
+
+ e.MoveNext();
+ Assert.That(e.Current.Key, Is.EqualTo("Meier"));
+ Assert.That(first(e.Current).FirstName, Is.EqualTo("Hubert"));
+
+ e.MoveNext();
+ Assert.That(e.Current.Key, Is.EqualTo("meier"));
+ Assert.That(first(e.Current).FirstName, Is.EqualTo("Isidor"));
+
+ Assert.That(e.MoveNext(), Is.False);
+ }
+
+ [Test]
+ public void
GroupBy_KeySelectorArgComparerArg_KeysThatDifferInCasingNonCaseSensitiveStringComparer_CorrectGrouping()
+ {
+ var persons =
Read(Person.CreatePersonsWithNamesUsingMixedCase());
+
+ var result = new Reader<IGrouping<string, Person>>(
+ persons.GroupBy(person => person.LastName,
StringComparer.CurrentCultureIgnoreCase));
+
+ var group1 = result.Read();
+ Assert.That(group1.Key, Is.EqualTo("M\u00FCller"));
+ var muellers = new Reader<Person>(group1);
+ Assert.That(muellers.Read().FirstName, Is.EqualTo("Peter"));
+ Assert.That(muellers.Read().FirstName, Is.EqualTo("Herbert"));
+
+ var group2 = result.Read();
+ Assert.That(group2.Key, Is.EqualTo("Meier"));
+ var meiers = new Reader<Person>(group2);
+ Assert.That(meiers.Read().FirstName, Is.EqualTo("Hubert"));
+ Assert.That(meiers.Read().FirstName, Is.EqualTo("Isidor"));
+
+ result.AssertEnded();
+ }
+
+ [Test]
+ public void
GroupBy_KeySelectorArgElementSelectorArg_ValidArguments_CorrectGroupingAndProjection()
+ {
+ var persons = Read(Person.CreatePersons());
+
+ var result = new Reader<IGrouping<string, int>>(
+ persons.GroupBy(person => person.LastName, person =>
person.Age));
+
+ var group1 = result.Read();
+ Assert.That(group1.Key, Is.EqualTo("M\u00FCller"));
+ var muellers = new Reader<int>(group1);
+ Assert.That(muellers.Read(), Is.EqualTo(21));
+ Assert.That(muellers.Read(), Is.EqualTo(22));
+
+ var group2 = result.Read();
+ Assert.That(group2.Key, Is.EqualTo("Meier"));
+ var meiers = new Reader<int>(group2);
+ Assert.That(meiers.Read(), Is.EqualTo(23));
+ Assert.That(meiers.Read(), Is.EqualTo(24));
+ }
+
+ [Test]
+ public void
GroupBy_KeySelectorArgResultSelectorArg_ValidArguments_CorrectGroupingProcessing()
+ {
+ var persons = Read(Person.CreatePersons());
+
+ var result = persons.GroupBy(
+ p => p.LastName,
+ (key, group) => {
+ var total = 0;
+ foreach (var p in group)
+ total += p.Age;
+ return key + ":" + total;
+ });
+
+ result.AssertEquals("M\u00FCller:43", "Meier:47");
+ }
+
+ [Test]
+ public void
GroupBy_KeySelectorArgElementSelectorArgComparerArg_ValidArguments_CorrectGroupingAndProcessing()
+ {
+ var persons =
Read(Person.CreatePersonsWithNamesUsingMixedCase());
+
+ var result = new Reader<IGrouping<string, int>>(
+ persons.GroupBy(p => p.LastName, p => p.Age,
StringComparer.CurrentCultureIgnoreCase));
+
+ var group1 = result.Read();
+ Assert.That(group1.Key, Is.EqualTo("M\u00FCller"));
+ var muellers = new Reader<int>(group1);
+ Assert.That(muellers.Read(), Is.EqualTo(21));
+ Assert.That(muellers.Read(), Is.EqualTo(22));
+
+ var group2 = result.Read();
+ Assert.That(group2.Key, Is.EqualTo("Meier"));
+ var meiers = new Reader<int>(group2);
+ Assert.That(meiers.Read(), Is.EqualTo(23));
+ Assert.That(meiers.Read(), Is.EqualTo(24));
+ }
+
+ [Test]
+ public void
GroupBy_KeySelectorArgElementSelectorArgResultSelectorArg_ValidArguments_CorrectGroupingAndTransforming()
+ {
+ var persons = Read(Person.CreatePersons());
+
+ var result = persons.GroupBy(
+ p => p.LastName,
+ p => p.Age,
+ (key, ages) => {
+ var total = 0;
+ foreach (var age in ages)
+ total += age;
+ return key + ":" + total;
+ });
+
+ result.AssertEquals("M\u00FCller:43", "Meier:47");
+ }
+
+ [Test]
+ public void
GroupBy_KeySelectorArgResultSelectorArgComparerArg_ValidArguments_CorrectGroupingAndTransforming()
+ {
+ var persons =
Read(Person.CreatePersonsWithNamesUsingMixedCase());
+
+ var result = persons.GroupBy(
+ p => p.LastName,
+ (key, values) => {
+ var total = 0;
+ foreach (var person in values)
+ total += person.Age;
+ return key + ":" + total;
+ },
+ StringComparer.CurrentCultureIgnoreCase);
+
+ result.AssertEquals("M\u00FCller:43", "Meier:47");
+ }
+
+ [Test]
+ public void
GroupBy_KeySelectorArgElementSelectorArgResultSelectorArgComparerArg_ValidArguments_CorrectGroupingAndTransforming()
+ {
+ var persons =
Read(Person.CreatePersonsWithNamesUsingMixedCase());
+
+ var result = persons.GroupBy(
+ p => p.LastName,
+ p => p.Age,
+ (key, ages) => {
+ var total = 0;
+ foreach (var age in ages)
+ total += age;
+ return key + ":" + total;
+ },
+ StringComparer.CurrentCultureIgnoreCase);
+
+ result.AssertEquals("M\u00FCller:43", "Meier:47");
+ }
+
+ class Pet
+ {
+ public string Name { get; set; }
+ public string Owner { get; set; }
+ }
+
+ [Test]
+ public void
GroupJoin_InnerArgOuterKeySelectorArgInnerKeySelectorArgResultSelectorArg_ValidArguments_CorrectGroupingAndJoining()
+ {
+ var persons = Read(Person.CreatePersons());
+
+ var barley = new Pet { Name = "Barley", Owner = "Peter"
};
+ var boots = new Pet { Name = "Boots", Owner = "Herbert"
};
+ var whiskers = new Pet { Name = "Whiskers", Owner = "Herbert"
};
+ var daisy = new Pet { Name = "Daisy", Owner = "Isidor"
};
+
+ var pets = Read(barley, boots, whiskers, daisy);
+
+ var result = persons.GroupJoin(pets, person =>
person.FirstName, pet => pet.Owner,
+ (person, ppets) => new { Owner = person,
Pets = ppets });
+
+ using (var e = result.GetEnumerator())
+ {
+ e.MoveNext(); Assert.That(e.Current.Owner.FirstName,
Is.EqualTo("Peter"));
+ e.Current.Pets.AssertThat(Is.SameAs, barley);
+
+ e.MoveNext(); Assert.That(e.Current.Owner.FirstName,
Is.EqualTo("Herbert"));
+ e.Current.Pets.AssertThat(Is.SameAs, boots, whiskers);
+
+ e.MoveNext(); Assert.That(e.Current.Owner.FirstName,
Is.EqualTo("Hubert"));
+ e.Current.Pets.AssertThat(Is.SameAs); // empty
+
+ e.MoveNext(); Assert.That(e.Current.Owner.FirstName,
Is.EqualTo("Isidor"));
+ e.Current.Pets.AssertThat(Is.SameAs, daisy);
+
+ Assert.That(e.MoveNext(), Is.False);
+ }
+ }
+
+ [Test]
+ public void
GroupJoin_InnerArgOuterKeySelectorArgInnerKeySelectorArgResultSelectorArgComparerArg_ValidArguments_CorrectGroupingAndJoining()
+ {
+ var persons = Read(Person.CreatePersons());
+
+ var barley = new Pet { Name = "Barley", Owner = "Peter"
};
+ var boots = new Pet { Name = "Boots", Owner = "Herbert"
};
+ var whiskers = new Pet { Name = "Whiskers", Owner = "HeRbErT"
};
+ var daisy = new Pet { Name = "Daisy", Owner = "Isidor"
};
+
+ var pets = Read(barley, boots, whiskers, daisy);
+
+ var result = persons.GroupJoin(pets, person =>
person.FirstName, pet => pet.Owner,
+ (person, ppets) => new { Owner = person,
Pets = ppets },
+ StringComparer.CurrentCultureIgnoreCase);
+
+ using (var e = result.GetEnumerator())
+ {
+ e.MoveNext(); Assert.That(e.Current.Owner.FirstName,
Is.EqualTo("Peter"));
+ e.Current.Pets.AssertThat(Is.SameAs, barley);
+
+ e.MoveNext(); Assert.That(e.Current.Owner.FirstName,
Is.EqualTo("Herbert"));
+ e.Current.Pets.AssertThat(Is.SameAs, boots, whiskers);
+
+ e.MoveNext(); Assert.That(e.Current.Owner.FirstName,
Is.EqualTo("Hubert"));
+ e.Current.Pets.AssertThat(Is.SameAs); // empty
+
+ e.MoveNext(); Assert.That(e.Current.Owner.FirstName,
Is.EqualTo("Isidor"));
+ e.Current.Pets.AssertThat(Is.SameAs, daisy);
+
+ Assert.That(e.MoveNext(), Is.False);
+ }
+ }
+
+ [Test]
+ [ExpectedException(typeof(ArgumentNullException))]
+ public void
GroupJoin_InnerArgOuterKeySelectorArgInnerKeySelectorArgResultSelectorArg_NullOuterKeySelector_ThrowsArgumentNullException()
+ {
+ new object[0].GroupJoin<object, object, object, object>(
+ new object[0], null,
+ delegate { throw new NotImplementedException(); },
+ delegate { throw new NotImplementedException(); });
+ }
+
+ [Test]
+ [ExpectedException(typeof(ArgumentNullException))]
+ public void
Intersect_NullSecondSource_ThrowsArgumentNullException()
+ {
+ Read<object>().Intersect(null);
+ }
+
+ [Test]
+ public void Intersect_IntegerSources_YieldsCommonSet()
***The diff for this file has been truncated for email.***
=======================================
--- /dev/null
+++ /test/LINQBridge.Tests/LINQBridge.Tests.csproj Sat Apr 30 05:48:09 2011
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="3.5" DefaultTargets="Build"
xmlns="
http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)'
== '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>9.0.30729</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{8CFA0EA5-31B9-43D0-A2D9-A002C2C25121}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>LinqBridge.Tests</RootNamespace>
+ <AssemblyName>LinqBridge.Tests</AssemblyName>
+ <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
+ <FileAlignment>512</FileAlignment>
+ <TargetFrameworkSubset>
+ </TargetFrameworkSubset>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|
AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <NoWarn>1685</NoWarn>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="nunit.framework, Version=2.4.8.0, Culture=neutral,
PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\..\tools\NUnit\nunit.framework.dll</HintPath>
+ </Reference>
+ <Reference Include="System" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="..\..\src\ExtensionAttribute.cs">
+ <Link>ExtensionAttribute.cs</Link>
+ </Compile>
+ <Compile Include="EnumerableFixture.cs" />
+ <Compile Include="Reader.cs" />
+ <Compile Include="Tester.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\src\LINQBridge.csproj">
+ <Project>{66621034-90CC-4D1A-B49E-73A13E3B22EF}</Project>
+ <Name>LINQBridge</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <Folder Include="Properties\" />
+ </ItemGroup>
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the
targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+</Project>
=======================================
--- /dev/null
+++ /test/LINQBridge.Tests/LINQBridge.Tests.ncover Sat Apr 30 05:48:09 2011
@@ -0,0 +1,37 @@
+<?xml version="1.0"?>
+<NCover3ProjectSetting
xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="
http://www.w3.org/2001/XMLSchema" Version="307">
+ <CoverageDataURL>C:\Users\Allon\Documents\Visual Studio
2008\Projects\LINQBridge\test\LINQBridge.Tests\bin\..\coverage.xml</CoverageDataURL>
+ <ShowExcludedNodes>true</ShowExcludedNodes>
+ <DefaultViewSetting SatisfactoryBranchThreshold="95"
SatisfactoryCoverageThreshold="95"
SatisfactoryCyclomaticComplexityThreshold="20"
SatisfactoryFunctionThreshold="80" SatisfactoryUnvisitedSequencePoints="0"
WidgetType="TreeView" FilterStyle="None"
ReportStyle="SequencePointCoveragePercentage" SortStyle="Name">
+ <DelayFilters>false</DelayFilters>
+ <filters />
+ </DefaultViewSetting>
+ <NCoverRunSettings>
+ <AutoExclude>true</AutoExclude>
+ <CommandLineArgs>/noshadow LinqBridge.Tests.dll</CommandLineArgs>
+ <CommandLineExe>C:\Program Files\NUnit
2.5\bin\net-2.0\nunit-console.exe</CommandLineExe>
+ <CoverageType>Symbol Branch CyclomaticComplexity
MethodVisits</CoverageType>
+ <CoverageXml>..\coverage.xml</CoverageXml>
+ <Assemblies>LinqBridge</Assemblies>
+ <LogFile>..\coverage.log</LogFile>
+ <LoggingLevel>None</LoggingLevel>
+ <NCoverExe>C:\Program Files\NCover\ncover.console.exe</NCoverExe>
+ <OnlyAssembliesWithSource>false</OnlyAssembliesWithSource>
+ <ProfileIIS>false</ProfileIIS>
+ <ProfileWindowsApplication>true</ProfileWindowsApplication>
+ <ProfileWindowsService>false</ProfileWindowsService>
+ <ProjectName>LINQBridge.Tests</ProjectName>
+ <RegisterForUser>false</RegisterForUser>
+ <ServiceTimeout>0</ServiceTimeout>
+ <SymbolSearchPolicy>15</SymbolSearchPolicy>
+ <ExpertMode>false</ExpertMode>
+ <VersionNumber>330</VersionNumber>
+ <WaitForAppLoad>1</WaitForAppLoad>
+ <WorkingDirectory>C:\Users\Allon\Documents\Visual Studio
2008\Projects\LINQBridge\test\LINQBridge.Tests\bin</WorkingDirectory>
+ </NCoverRunSettings>
+ <ProjectGuid>ed54477a-bf2b-42c1-9b4c-f6ab7204b00c</ProjectGuid>
+ <ProjectName>LINQBridge.Tests</ProjectName>
+ <RebasedPaths />
+ <ReportPath />
+ <SyncPathWithWorkingDirectory>false</SyncPathWithWorkingDirectory>
+</NCover3ProjectSetting>
=======================================
--- /dev/null
+++ /test/LINQBridge.Tests/Reader.cs Sat Apr 30 05:48:09 2011
@@ -0,0 +1,162 @@
+#region License, Terms and Author(s)
+//
+// LINQBridge
+// Copyright (c) 2007-9 Atif Aziz, Joseph Albahari. All rights reserved.
+//
+// Author(s):
+//
+// Dominik Hug,
http://www.dominikhug.ch
+// Atif Aziz,
http://www.raboof.com
+//
+// This library is free software; you can redistribute it and/or modify it
+// under the terms of the New BSD License, a copy of which should have
+// been delivered along with this distribution.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+#endregion
+
+namespace LinqBridge.Tests
+{
+ #region Imports
+
+ using System;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Diagnostics;
+ using NUnit.Framework;
+ using NUnit.Framework.Constraints;
+ using NUnit.Framework.SyntaxHelpers;
+
+ #endregion
+
+ internal sealed class Reader<T> : IEnumerable<T>, IEnumerator<T>
+ {
+ public event EventHandler Disposed;
+ public event EventHandler Enumerated;
+
+ private IEnumerable<T> source;
+ private IEnumerator<T> cursor;
+
+ public Reader(IEnumerable<T> values)
+ {
+ Debug.Assert(values != null);
+ source = values;
+ }
+
+ private IEnumerator<T> Enumerator
+ {
+ get
+ {
+ if (cursor == null)
+ GetEnumerator();
+ return this;
+ }
+ }
+
+ public object EOF
+ {
+ get { return Enumerator.MoveNext(); }
+ }
+
+ public IEnumerator<T> GetEnumerator()
+ {
+ if (source == null) throw new Exception("A LINQ Operator
called GetEnumerator() twice.");
+ cursor = source.GetEnumerator();
+ source = null;
+
+ var handler = Enumerated;
+ if (handler != null)
+ handler(this, EventArgs.Empty);
+
+ return this;
+ }
+
+ IEnumerator IEnumerable.GetEnumerator()
+ {
+ return GetEnumerator();
+ }
+
+ public T Read()
+ {
+ if (!Enumerator.MoveNext())
+ throw new InvalidOperationException("No more elements in
the source sequence.");
+ return Enumerator.Current;
+ }
+
+ void IDisposable.Dispose()
+ {
+ source = null;
+ var e = cursor;
+ cursor = null;
+
+ if (e != null)
+ {
+ e.Dispose();
+
+ var handler = Disposed;
+ if (handler != null)
+ handler(this, EventArgs.Empty);
+ }
+ }
+
+ private IEnumerator<T> GetSourceEnumerator()
+ {
+ if (source != null && cursor == null)
+ throw new InvalidOperationException(/* GetEnumerator not
called yet */);
+ if (source == null && cursor == null)
+ throw new ObjectDisposedException(GetType().FullName);
+
+ return cursor;
+ }
+
+ bool IEnumerator.MoveNext()
+ {
+ return GetSourceEnumerator().MoveNext();
+ }
+
+ void IEnumerator.Reset()
+ {
+ GetSourceEnumerator().Reset();
+ }
+
+ T IEnumerator<T>.Current
+ {
+ get { return GetSourceEnumerator().Current; }
+ }
+
+ object IEnumerator.Current
+ {
+ get { return ((IEnumerator<T>) this).Current; }
+ }
+ }
+
+ internal static class ReaderTestExtensions
+ {
+ public static void AssertEnded<T>(this Reader<T> reader)
+ {
+ Debug.Assert(reader != null);
+
+ Assert.That(reader.EOF, Is.False, "Too many elements in
source.");
+ }
+
+ public static Reader<T> AssertNext<T>(this Reader<T> reader,
Constraint constraint)
+ {
+ Debug.Assert(reader != null);
+ Debug.Assert(constraint != null);
+
+ Assert.That(reader.Read(), constraint);
+ return reader;
+ }
+ }
+}
=======================================
--- /dev/null
+++ /test/LINQBridge.Tests/Tester.cs Sat Apr 30 05:48:09 2011
@@ -0,0 +1,61 @@
+#region License, Terms and Author(s)
+//
+// LINQBridge
+// Copyright (c) 2007-9 Atif Aziz, Joseph Albahari. All rights reserved.
+//
+// Author(s):
+//
+// Dominik Hug,
http://www.dominikhug.ch
+//
+// This library is free software; you can redistribute it and/or modify it
+// under the terms of the New BSD License, a copy of which should have
+// been delivered along with this distribution.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+#endregion
+
+namespace LinqBridge.Tests
+{
+ #region Imports
+
+ using System;
+ using System.Collections.Generic;
+ using NUnit.Framework;
+ using NUnit.Framework.Constraints;
+ using NUnit.Framework.SyntaxHelpers;
+
+ #endregion
+
+ internal static class Tester
+ {
+ public static void AssertEquals<T>(this IEnumerable<T> actuals,
params T[] expectations)
+ {
+ actuals.AssertThat(a => Is.EqualTo(a), expectations);
+ }
+
+ public static void AssertThat<T>(this IEnumerable<T> actuals,
Func<T, Constraint> constrainer, params T[] expectations)
+ {
+ using (var e = actuals.GetEnumerator())
+ {
+ foreach (var expected in expectations)
+ {
+ e.MoveNext();
+ Assert.That(e.Current, constrainer(expected));
+ }
+
+ Assert.That(e.MoveNext(), Is.False);
+ }
+ }
+ }
+}
=======================================
--- /dev/null
+++ /test/LINQBridge.Tests/coverage.xml Sat Apr 30 05:48:09 2011
@@ -0,0 +1,1673 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- saved from NCover 3.0 Export url='
http://www.ncover.com/' -->
+<coverage profilerVersion="3.3.0.6070" driverVersion="3.3.0"
exportversion="3" viewdisplayname="LINQBridge.Tests"
startTime="2009-10-15T11:58:30.9516127Z"
measureTime="2009-10-15T11:58:35.7345097Z" projectName="LINQBridge.Tests"
buildid="405ccc48-d75d-4302-b59d-aa91c9c98458" coveragenodeid="0"
failed="false" satisfactorybranchthreshold="95"
satisfactorycoveragethreshold="95"
satisfactorycyclomaticcomplexitythreshold="20"
satisfactoryfunctionthreshold="80" satisfactoryunvisitedsequencepoints="0"
uiviewtype="TreeView" viewguid="LINQBridge.Tests" viewfilterstyle="None"
viewreportstyle="SequencePointCoveragePercentage" viewsortstyle="Name">
+ <rebasedpaths />
+ <filters />
+ <documents>
+ <doc id="3" excluded="false" url="C:\Users\Allon\Documents\Visual
Studio 2008\Projects\LINQBridge\src\Enumerable.cs"
cs="3FB6F95A8AE6C5ECDCB2398B435B4B4F"
csa="406ea660-64cf-4c82-b6f0-42d48172a799" om="20" nid="0" />
+ <doc id="2" excluded="false" url="C:\Users\Allon\Documents\Visual
Studio 2008\Projects\LINQBridge\src\Enumerable.g.cs"
cs="A4346B0D8BEE1923F6A819E778D98D5C"
csa="406ea660-64cf-4c82-b6f0-42d48172a799" om="20" nid="0" />
+ <doc id="4" excluded="false" url="C:\Users\Allon\Documents\Visual
Studio 2008\Projects\LINQBridge\src\Lookup.cs"
cs="9174F7EA93BBFA83AA10C2CA70E9C6F7"
csa="406ea660-64cf-4c82-b6f0-42d48172a799" om="20" nid="0" />
+ <doc id="1" excluded="false" url="C:\Users\Allon\Documents\Visual
Studio 2008\Projects\LINQBridge\src\OrderedEnumerable.cs"
cs="2AAD3D16F405440CFB178A3088C3E384"
csa="406ea660-64cf-4c82-b6f0-42d48172a799" om="20" nid="0" />
+ <doc id="5" excluded="false" url="C:\Users\Allon\Documents\Visual
Studio 2008\Projects\LINQBridge\src\Tuple.cs"
cs="E8A21D97B680D604F9D5F93AD8FD7FA3"
csa="406ea660-64cf-4c82-b6f0-42d48172a799" om="20" nid="0" />
+ <doc id="0" excluded="false" url="None" cs=""
csa="00000000-0000-0000-0000-000000000000" om="0" nid="0" />
+ </documents>
+ <module moduleId="20" name="C:\Users\Allon\Documents\Visual Studio
2008\Projects\LINQBridge\test\LINQBridge.Tests\bin\LinqBridge.dll"
assembly="LinqBridge" assemblyIdentity="LinqBridge, Version=1.1.0.0,
Culture=neutral, PublicKeyToken=c2b14eb747628076,
processorArchitecture=MSIL" nid="0">
+ <class name="System.Linq.Enumerable"
signature="System.Linq.Enumerable" excluded="false" nid="0">
+ <method name="<Aggregate>b__ae"
signature="<Aggregate>b__ae<TSource,TAccumulate>(TAccumulate
r) : TAccumulate [static]" excluded="false" instrumented="true" cc="0"
vc="34" nid="0">
+ <seqpnt vc="34" o="0" l="1080" el="1080" c="55" ec="56" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="<Average>b__0"
signature="<Average>b__0(System.Nullable<System.Int32> n) :
System.Boolean [static]" excluded="false" instrumented="true" cc="0"
vc="10" nid="0">
+ <seqpnt vc="10" o="0" l="153" el="153" c="51" ec="60" ex="false"
fl="65536" doc="2" nid="0" />
+ </method>
+ <method name="<Average>b__14"
signature="<Average>b__14(System.Nullable<System.Single> n) :
System.Boolean [static]" excluded="false" instrumented="true" cc="0"
vc="10" nid="0">
+ <seqpnt vc="10" o="0" l="525" el="525" c="51" ec="60" ex="false"
fl="65536" doc="2" nid="0" />
+ </method>
+ <method name="<Average>b__1e"
signature="<Average>b__1e(System.Nullable<System.Double> n) :
System.Boolean [static]" excluded="false" instrumented="true" cc="0"
vc="10" nid="0">
+ <seqpnt vc="10" o="0" l="711" el="711" c="51" ec="60" ex="false"
fl="65536" doc="2" nid="0" />
+ </method>
+ <method name="<Average>b__28"
signature="<Average>b__28(System.Nullable<System.Decimal> n) :
System.Boolean [static]" excluded="false" instrumented="true" cc="0"
vc="10" nid="0">
+ <seqpnt vc="10" o="0" l="897" el="897" c="51" ec="60" ex="false"
fl="65536" doc="2" nid="0" />
+ </method>
+ <method name="<Average>b__a"
signature="<Average>b__a(System.Nullable<System.Int64> n) :
System.Boolean [static]" excluded="false" instrumented="true" cc="0"
vc="10" nid="0">
+ <seqpnt vc="10" o="0" l="339" el="339" c="51" ec="60" ex="false"
fl="65536" doc="2" nid="0" />
+ </method>
+ <method name="<Count>b__93"
signature="<Count>b__93<TSource>(System.Int32 count,TSource
item) : System.Int32 [static]" excluded="false" instrumented="true" cc="0"
vc="5" nid="0">
+ <seqpnt vc="5" o="0" l="711" el="711" c="57" ec="75" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="<GroupBy>b__a7"
signature="<GroupBy>b__a7<TSource,TKey>(TSource e) : TSource
[static]" excluded="false" instrumented="true" cc="0" vc="12" nid="0">
+ <seqpnt vc="12" o="0" l="941" el="941" c="54" ec="55" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="<LongCount>b__94"
signature="<LongCount>b__94<TSource>(System.Int64 count,TSource
item) : System.Int64 [static]" excluded="false" instrumented="true" cc="0"
vc="6" nid="0">
+ <seqpnt vc="6" o="0" l="739" el="739" c="58" ec="67" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="<Max>b__10"
signature="<Max>b__10(System.Nullable<System.Int64> x) :
System.Boolean [static]" excluded="false" instrumented="true" cc="0" vc="8"
nid="0">
+ <seqpnt vc="8" o="0" l="400" el="400" c="49" ec="58" ex="false"
fl="65536" doc="2" nid="0" />
+ </method>
+ <method name="<Max>b__11"
signature="<Max>b__11(System.Nullable<System.Int64>
max,System.Nullable<System.Int64> x) : System.Boolean [static]"
excluded="false" instrumented="true" cc="0" vc="6" nid="0">
+ <seqpnt vc="6" o="0" l="401" el="401" c="35" ec="84" ex="false"
fl="65536" doc="2" nid="0" />
+ </method>
+ <method name="<Max>b__1a"
signature="<Max>b__1a(System.Nullable<System.Single> x) :
System.Boolean [static]" excluded="false" instrumented="true" cc="0" vc="8"
nid="0">
+ <seqpnt vc="8" o="0" l="586" el="586" c="49" ec="58" ex="false"
fl="65536" doc="2" nid="0" />
+ </method>
+ <method name="<Max>b__1b"
signature="<Max>b__1b(System.Nullable<System.Single>
max,System.Nullable<System.Single> x) : System.Boolean [static]"
excluded="false" instrumented="true" cc="0" vc="6" nid="0">
+ <seqpnt vc="6" o="0" l="587" el="587" c="35" ec="84" ex="false"
fl="65536" doc="2" nid="0" />
+ </method>
+ <method name="<Max>b__24"
signature="<Max>b__24(System.Nullable<System.Double> x) :
System.Boolean [static]" excluded="false" instrumented="true" cc="0" vc="8"
nid="0">
+ <seqpnt vc="8" o="0" l="772" el="772" c="49" ec="58" ex="false"
fl="65536" doc="2" nid="0" />
+ </method>
+ <method name="<Max>b__25"
signature="<Max>b__25(System.Nullable<System.Double>
max,System.Nullable<System.Double> x) : System.Boolean [static]"
excluded="false" instrumented="true" cc="0" vc="6" nid="0">
+ <seqpnt vc="6" o="0" l="773" el="773" c="35" ec="84" ex="false"
fl="65536" doc="2" nid="0" />
+ </method>
+ <method name="<Max>b__2e"
signature="<Max>b__2e(System.Nullable<System.Decimal> x) :
System.Boolean [static]" excluded="false" instrumented="true" cc="0" vc="8"
nid="0">
+ <seqpnt vc="8" o="0" l="958" el="958" c="49" ec="58" ex="false"
fl="65536" doc="2" nid="0" />
+ </method>
+ <method name="<Max>b__2f"
signature="<Max>b__2f(System.Nullable<System.Decimal>
max,System.Nullable<System.Decimal> x) : System.Boolean [static]"
excluded="false" instrumented="true" cc="0" vc="6" nid="0">
+ <seqpnt vc="6" o="0" l="959" el="959" c="35" ec="84" ex="false"
fl="65536" doc="2" nid="0" />
+ </method>
+ <method name="<Max>b__6"
signature="<Max>b__6(System.Nullable<System.Int32> x) :
System.Boolean [static]" excluded="false" instrumented="true" cc="0"
vc="14" nid="0">
+ <seqpnt vc="14" o="0" l="214" el="214" c="49" ec="58" ex="false"
fl="65536" doc="2" nid="0" />
+ </method>
+ <method name="<Max>b__7"
signature="<Max>b__7(System.Nullable<System.Int32>
max,System.Nullable<System.Int32> x) : System.Boolean [static]"
excluded="false" instrumented="true" cc="0" vc="8" nid="0">
+ <seqpnt vc="8" o="0" l="215" el="215" c="35" ec="84" ex="false"
fl="65536" doc="2" nid="0" />
+ </method>
+ <method name="<Min>b__16"
signature="<Min>b__16(System.Nullable<System.Single> x) :
System.Boolean [static]" excluded="false" instrumented="true" cc="0" vc="7"
nid="0">
+ <seqpnt vc="7" o="0" l="561" el="561" c="49" ec="58" ex="false"
fl="65536" doc="2" nid="0" />
+ </method>
+ <method name="<Min>b__17"
signature="<Min>b__17(System.Nullable<System.Single>
min,System.Nullable<System.Single> x) : System.Boolean [static]"
excluded="false" instrumented="true" cc="0" vc="5" nid="0">
+ <seqpnt vc="5" o="0" l="561" el="561" c="79" ec="86" ex="false"
fl="65536" doc="2" nid="0" />
+ </method>
+ <method name="<Min>b__2"
signature="<Min>b__2(System.Nullable<System.Int32> x) :
System.Boolean [static]" excluded="false" instrumented="true" cc="0"
vc="12" nid="0">
+ <seqpnt vc="12" o="0" l="189" el="189" c="49" ec="58" ex="false"
fl="65536" doc="2" nid="0" />
+ </method>
+ <method name="<Min>b__20"
signature="<Min>b__20(System.Nullable<System.Double> x) :
System.Boolean [static]" excluded="false" instrumented="true" cc="0" vc="7"
nid="0">
+ <seqpnt vc="7" o="0" l="747" el="747" c="49" ec="58" ex="false"
fl="65536" doc="2" nid="0" />
+ </method>
+ <method name="<Min>b__21"
signature="<Min>b__21(System.Nullable<System.Double>
min,System.Nullable<System.Double> x) : System.Boolean [static]"
excluded="false" instrumented="true" cc="0" vc="5" nid="0">
+ <seqpnt vc="5" o="0" l="747" el="747" c="79" ec="86" ex="false"
fl="65536" doc="2" nid="0" />
+ </method>
+ <method name="<Min>b__2a"
signature="<Min>b__2a(System.Nullable<System.Decimal> x) :
System.Boolean [static]" excluded="false" instrumented="true" cc="0" vc="7"
nid="0">
+ <seqpnt vc="7" o="0" l="933" el="933" c="49" ec="58" ex="false"
fl="65536" doc="2" nid="0" />
+ </method>
+ <method name="<Min>b__2b"
signature="<Min>b__2b(System.Nullable<System.Decimal>
min,System.Nullable<System.Decimal> x) : System.Boolean [static]"
excluded="false" instrumented="true" cc="0" vc="5" nid="0">
+ <seqpnt vc="5" o="0" l="933" el="933" c="79" ec="86" ex="false"
fl="65536" doc="2" nid="0" />
+ </method>
+ <method name="<Min>b__3"
signature="<Min>b__3(System.Nullable<System.Int32>
min,System.Nullable<System.Int32> x) : System.Boolean [static]"
excluded="false" instrumented="true" cc="0" vc="9" nid="0">
+ <seqpnt vc="9" o="0" l="189" el="189" c="79" ec="86" ex="false"
fl="65536" doc="2" nid="0" />
+ </method>
+ <method name="<Min>b__c"
signature="<Min>b__c(System.Nullable<System.Int64> x) :
System.Boolean [static]" excluded="false" instrumented="true" cc="0"
vc="12" nid="0">
+ <seqpnt vc="12" o="0" l="375" el="375" c="49" ec="58" ex="false"
fl="65536" doc="2" nid="0" />
+ </method>
+ <method name="<Min>b__d"
signature="<Min>b__d(System.Nullable<System.Int64>
min,System.Nullable<System.Int64> x) : System.Boolean [static]"
excluded="false" instrumented="true" cc="0" vc="9" nid="0">
+ <seqpnt vc="9" o="0" l="375" el="375" c="79" ec="86" ex="false"
fl="65536" doc="2" nid="0" />
+ </method>
+ <method name="<SelectMany>b__5f"
signature="<SelectMany>b__5f<TSource,TResult>(TSource
item,TResult subitem) : TResult [static]" excluded="false"
instrumented="true" cc="0" vc="31" nid="0">
+ <seqpnt vc="31" o="0" l="251" el="251" c="67" ec="74" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="<ToDictionary>b__ca"
signature="<ToDictionary>b__ca<TSource,TKey>(TSource e) :
TSource [static]" excluded="false" instrumented="true" cc="0" vc="8"
nid="0">
+ <seqpnt vc="8" o="0" l="1600" el="1600" c="58" ec="59" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="<ToLookup>b__a5"
signature="<ToLookup>b__a5<TSource,TKey>(TSource e) : TSource
[static]" excluded="false" instrumented="true" cc="0" vc="5" nid="0">
+ <seqpnt vc="5" o="0" l="852" el="852" c="55" ec="56" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="<ToLookup>b__a6"
signature="<ToLookup>b__a6<TSource,TKey>(TSource e) : TSource
[static]" excluded="false" instrumented="true" cc="0" vc="24" nid="0">
+ <seqpnt vc="24" o="0" l="866" el="866" c="55" ec="56" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="Aggregate"
signature="Aggregate<TSource,TAccumulate,TResult>(System.Collections.Generic.IEnumerable<TSource>
source,TAccumulate seed,System.Func<TAccumulate,TSource,TAccumulate>
func,System.Func<TAccumulate,TResult> resultSelector) : TResult
[static]" excluded="false" instrumented="true" cc="0" vc="34" nid="0">
+ <seqpnt vc="34" o="1" l="1095" el="1095" c="13" ec="44" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="34" o="D" l="1096" el="1096" c="13" ec="40" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="34" o="19" l="1097" el="1097" c="13" ec="60"
ex="false" fl="65536" doc="3" nid="0" />
+ <seqpnt vc="34" o="25" l="1099" el="1099" c="13" ec="31"
ex="false" fl="65536" doc="3" nid="0" />
+ <seqpnt vc="34" o="28" l="1101" el="1101" c="34" ec="40"
ex="false" fl="65536" doc="3" nid="0" />
+ <seqpnt vc="128" o="31" l="1101" el="1101" c="22" ec="30"
ex="false" fl="65536" doc="3" nid="0" />
+ <seqpnt vc="128" o="38" l="1102" el="1102" c="17" ec="45"
ex="false" fl="65536" doc="3" nid="0" />
+ <seqpnt vc="162" o="41" l="1101" el="1101" c="31" ec="33"
ex="false" fl="65536" doc="3" nid="0" />
+ <seqpnt vc="34" o="62" l="1104" el="1104" c="13" ec="43"
ex="false" fl="65536" doc="3" nid="0" />
+ <seqpnt vc="34" o="6C" l="1105" el="1105" c="9" ec="10" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="Aggregate"
signature="Aggregate<TSource,TAccumulate>(System.Collections.Generic.IEnumerable<TSource>
source,TAccumulate seed,System.Func<TAccumulate,TSource,TAccumulate>
func) : TAccumulate [static]" excluded="false" instrumented="true" cc="0"
vc="34" nid="0">
+ <seqpnt vc="34" o="1" l="1080" el="1080" c="13" ec="58" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="34" o="18" l="1081" el="1081" c="9" ec="10" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="Aggregate"
signature="Aggregate<TSource>(System.Collections.Generic.IEnumerable<TSource>
source,System.Func<TSource,TSource,TSource> func) : TSource [static]"
excluded="false" instrumented="true" cc="0" vc="3" nid="0">
+ <seqpnt vc="10" o="1" l="1058" el="1058" c="13" ec="44" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="9" o="D" l="1059" el="1059" c="13" ec="40" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="8" o="19" l="1061" el="1061" c="20" ec="50" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="8" o="21" l="1063" el="1063" c="17" ec="35" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="3" o="2B" l="1064" el="1064" c="21" ec="59" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="5" o="31" l="1066" el="1066" c="17" ec="75" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="5" o="5D" l="1068" el="1068" c="9" ec="10" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="All"
signature="All<TSource>(System.Collections.Generic.IEnumerable<TSource>
source,System.Func<TSource,System.Boolean> predicate) :
System.Boolean [static]" excluded="false" instrumented="true" cc="0" vc="1"
nid="0">
+ <seqpnt vc="3" o="1" l="1179" el="1179" c="13" ec="44" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="2" o="D" l="1180" el="1180" c="13" ec="50" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="2" o="1A" l="1182" el="1182" c="34" ec="40" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="8" o="23" l="1182" el="1182" c="22" ec="30" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="8" o="2A" l="1183" el="1183" c="17" ec="38" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="1" o="35" l="1184" el="1184" c="21" ec="34" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="9" o="39" l="1182" el="1182" c="31" ec="33" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="1" o="56" l="1186" el="1186" c="13" ec="25" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="2" o="5B" l="1187" el="1187" c="9" ec="10" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="Any"
signature="Any<TSource>(System.Collections.Generic.IEnumerable<TSource>
source) : System.Boolean [static]" excluded="false" instrumented="true"
cc="0" vc="6" nid="0">
+ <seqpnt vc="7" o="1" l="1196" el="1196" c="13" ec="44" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="6" o="D" l="1198" el="1198" c="20" ec="50" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="6" o="14" l="1199" el="1199" c="17" ec="37" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="6" o="2E" l="1200" el="1200" c="9" ec="10" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="Any"
signature="Any<TSource>(System.Collections.Generic.IEnumerable<TSource>
source,System.Func<TSource,System.Boolean> predicate) :
System.Boolean [static]" excluded="false" instrumented="true" cc="0" vc="4"
nid="0">
+ <seqpnt vc="4" o="1" l="1211" el="1211" c="13" ec="50" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="4" o="10" l="1212" el="1212" c="9" ec="10" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="AsEnumerable"
signature="AsEnumerable<TSource>(System.Collections.Generic.IEnumerable<TSource>
source) : System.Collections.Generic.IEnumerable<TSource> [static]"
excluded="false" instrumented="true" cc="0" vc="2" nid="0">
+ <seqpnt vc="2" o="1" l="55" el="55" c="13" ec="27" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="2" o="5" l="56" el="56" c="9" ec="10" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="Average"
signature="Average(System.Collections.Generic.IEnumerable<System.Decimal>
source) : System.Decimal [static]" excluded="false" instrumented="true"
cc="0" vc="1" nid="0">
+ <seqpnt vc="3" o="1" l="824" el="824" c="13" ec="44" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="3" o="D" l="826" el="826" c="13" ec="29" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="3" o="14" l="827" el="827" c="13" ec="28" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="3" o="18" l="829" el="829" c="33" ec="39" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="6" o="22" l="829" el="829" c="22" ec="29" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="6" o="2B" l="832" el="832" c="17" ec="38" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="6" o="33" l="833" el="833" c="17" ec="25" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="9" o="39" l="829" el="829" c="30" ec="32" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="3" o="5D" l="836" el="836" c="13" ec="28" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="1" o="6B" l="837" el="837" c="17" ec="55" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="2" o="71" l="839" el="839" c="13" ec="42" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="2" o="80" l="840" el="840" c="9" ec="10" ex="false"
fl="65536" doc="2" nid="0" />
+ </method>
+ <method name="Average"
signature="Average(System.Collections.Generic.IEnumerable<System.Double>
source) : System.Double [static]" excluded="false" instrumented="true"
cc="0" vc="1" nid="0">
+ <seqpnt vc="3" o="1" l="638" el="638" c="13" ec="44" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="3" o="D" l="640" el="640" c="13" ec="28" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="3" o="17" l="641" el="641" c="13" ec="28" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="3" o="1B" l="643" el="643" c="33" ec="39" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="6" o="25" l="643" el="643" c="22" ec="29" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="6" o="2F" l="646" el="646" c="17" ec="37" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="6" o="34" l="647" el="647" c="17" ec="25" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="9" o="3A" l="643" el="643" c="30" ec="32" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="3" o="5E" l="650" el="650" c="13" ec="28" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="1" o="6C" l="651" el="651" c="17" ec="55" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="2" o="72" l="653" el="653" c="13" ec="41" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="2" o="7A" l="654" el="654" c="9" ec="10" ex="false"
fl="65536" doc="2" nid="0" />
+ </method>
+ <method name="Average"
signature="Average(System.Collections.Generic.IEnumerable<System.Int32>
source) : System.Double [static]" excluded="false" instrumented="true"
cc="0" vc="1" nid="0">
+ <seqpnt vc="2" o="1" l="80" el="80" c="13" ec="44" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="2" o="D" l="82" el="82" c="13" ec="26" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="2" o="10" l="83" el="83" c="13" ec="28" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="2" o="14" l="85" el="85" c="33" ec="39" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="4" o="1E" l="85" el="85" c="22" ec="29" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="4" o="27" l="88" el="88" c="17" ec="34" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="4" o="2C" l="89" el="89" c="17" ec="25" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="6" o="32" l="85" el="85" c="30" ec="32" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="2" o="56" l="92" el="92" c="13" ec="28" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="1" o="64" l="93" el="93" c="17" ec="55" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="1" o="6A" l="95" el="95" c="13" ec="41" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="1" o="72" l="96" el="96" c="9" ec="10" ex="false"
fl="65536" doc="2" nid="0" />
+ </method>
+ <method name="Average"
signature="Average(System.Collections.Generic.IEnumerable<System.Int64>
source) : System.Double [static]" excluded="false" instrumented="true"
cc="0" vc="1" nid="0">
+ <seqpnt vc="3" o="1" l="266" el="266" c="13" ec="44" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="3" o="D" l="268" el="268" c="13" ec="26" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="3" o="10" l="269" el="269" c="13" ec="28" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="3" o="14" l="271" el="271" c="33" ec="39" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="4" o="1E" l="271" el="271" c="22" ec="29" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="4" o="27" l="274" el="274" c="17" ec="35" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="4" o="2B" l="275" el="275" c="17" ec="25" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="7" o="31" l="271" el="271" c="30" ec="32" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="3" o="55" l="278" el="278" c="13" ec="28" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="1" o="63" l="279" el="279" c="17" ec="55" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="2" o="69" l="281" el="281" c="13" ec="41" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="2" o="71" l="282" el="282" c="9" ec="10" ex="false"
fl="65536" doc="2" nid="0" />
+ </method>
+ <method name="Average"
signature="Average(System.Collections.Generic.IEnumerable<System.Nullable<System.Decimal>>
source) : System.Nullable<System.Decimal> [static]" excluded="false"
instrumented="true" cc="0" vc="1" nid="0">
+ <seqpnt vc="3" o="1" l="892" el="892" c="13" ec="44" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="3" o="D" l="894" el="894" c="13" ec="29" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="3" o="14" l="895" el="895" c="13" ec="28" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="3" o="18" l="897" el="897" c="33" ec="61" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="6" o="46" l="897" el="897" c="22" ec="29" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="6" o="4F" l="900" el="900" c="17" ec="38" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="6" o="5D" l="901" el="901" c="17" ec="25" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="9" o="63" l="897" el="897" c="30" ec="32" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="3" o="87" l="904" el="904" c="13" ec="28" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="1" o="95" l="905" el="905" c="17" ec="29" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="2" o="A2" l="907" el="907" c="13" ec="43" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="3" o="DD" l="908" el="908" c="9" ec="10" ex="false"
fl="65536" doc="2" nid="0" />
+ </method>
+ <method name="Average"
signature="Average(System.Collections.Generic.IEnumerable<System.Nullable<System.Double>>
source) : System.Nullable<System.Double> [static]" excluded="false"
instrumented="true" cc="0" vc="1" nid="0">
+ <seqpnt vc="3" o="1" l="706" el="706" c="13" ec="44" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="3" o="D" l="708" el="708" c="13" ec="28" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="3" o="17" l="709" el="709" c="13" ec="28" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="3" o="1B" l="711" el="711" c="33" ec="61" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="6" o="49" l="711" el="711" c="22" ec="29" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="6" o="52" l="714" el="714" c="17" ec="37" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="6" o="5D" l="715" el="715" c="17" ec="25" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="9" o="63" l="711" el="711" c="30" ec="32" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="3" o="87" l="718" el="718" c="13" ec="28" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="1" o="95" l="719" el="719" c="17" ec="29" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="2" o="A2" l="721" el="721" c="13" ec="42" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="3" o="D6" l="722" el="722" c="9" ec="10" ex="false"
fl="65536" doc="2" nid="0" />
+ </method>
+ <method name="Average"
signature="Average(System.Collections.Generic.IEnumerable<System.Nullable<System.Int32>>
source) : System.Nullable<System.Double> [static]" excluded="false"
instrumented="true" cc="0" vc="2" nid="0">
+ <seqpnt vc="4" o="1" l="148" el="148" c="13" ec="44" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="4" o="D" l="150" el="150" c="13" ec="26" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="4" o="10" l="151" el="151" c="13" ec="28" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="4" o="14" l="153" el="153" c="33" ec="61" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="6" o="42" l="153" el="153" c="22" ec="29" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="6" o="4B" l="156" el="156" c="17" ec="34" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="6" o="56" l="157" el="157" c="17" ec="25" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="10" o="5C" l="153" el="153" c="30" ec="32" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="4" o="80" l="160" el="160" c="13" ec="28" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="2" o="8E" l="161" el="161" c="17" ec="29" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="2" o="9B" l="163" el="163" c="13" ec="42" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="4" o="D0" l="164" el="164" c="9" ec="10" ex="false"
fl="65536" doc="2" nid="0" />
+ </method>
+ <method name="Average"
signature="Average(System.Collections.Generic.IEnumerable<System.Nullable<System.Int64>>
source) : System.Nullable<System.Double> [static]" excluded="false"
instrumented="true" cc="0" vc="1" nid="0">
+ <seqpnt vc="3" o="1" l="334" el="334" c="13" ec="44" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="3" o="D" l="336" el="336" c="13" ec="26" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="3" o="10" l="337" el="337" c="13" ec="28" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="3" o="14" l="339" el="339" c="33" ec="61" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="6" o="42" l="339" el="339" c="22" ec="29" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="6" o="4B" l="342" el="342" c="17" ec="35" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="6" o="55" l="343" el="343" c="17" ec="25" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="9" o="5B" l="339" el="339" c="30" ec="32" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="3" o="7F" l="346" el="346" c="13" ec="28" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="1" o="8D" l="347" el="347" c="17" ec="29" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="2" o="9A" l="349" el="349" c="13" ec="42" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="3" o="CF" l="350" el="350" c="9" ec="10" ex="false"
fl="65536" doc="2" nid="0" />
+ </method>
+ <method name="Average"
signature="Average(System.Collections.Generic.IEnumerable<System.Nullable<System.Single>>
source) : System.Nullable<System.Single> [static]" excluded="false"
instrumented="true" cc="0" vc="1" nid="0">
+ <seqpnt vc="3" o="1" l="520" el="520" c="13" ec="44" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="3" o="D" l="522" el="522" c="13" ec="27" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="3" o="13" l="523" el="523" c="13" ec="28" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="3" o="17" l="525" el="525" c="33" ec="61" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="6" o="45" l="525" el="525" c="22" ec="29" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="6" o="4E" l="528" el="528" c="17" ec="36" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="6" o="59" l="529" el="529" c="17" ec="25" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="9" o="5F" l="525" el="525" c="30" ec="32" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="3" o="83" l="532" el="532" c="13" ec="28" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="1" o="91" l="533" el="533" c="17" ec="29" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="2" o="9E" l="535" el="535" c="13" ec="41" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="3" o="D2" l="536" el="536" c="9" ec="10" ex="false"
fl="65536" doc="2" nid="0" />
+ </method>
+ <method name="Average"
signature="Average(System.Collections.Generic.IEnumerable<System.Single>
source) : System.Single [static]" excluded="false" instrumented="true"
cc="0" vc="1" nid="0">
+ <seqpnt vc="3" o="1" l="452" el="452" c="13" ec="44" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="3" o="D" l="454" el="454" c="13" ec="27" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="3" o="13" l="455" el="455" c="13" ec="28" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="3" o="17" l="457" el="457" c="33" ec="39" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="6" o="21" l="457" el="457" c="22" ec="29" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="6" o="2B" l="460" el="460" c="17" ec="36" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="6" o="30" l="461" el="461" c="17" ec="25" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="9" o="36" l="457" el="457" c="30" ec="32" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="3" o="5A" l="464" el="464" c="13" ec="28" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="1" o="68" l="465" el="465" c="17" ec="55" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="2" o="6E" l="467" el="467" c="13" ec="40" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="2" o="76" l="468" el="468" c="9" ec="10" ex="false"
fl="65536" doc="2" nid="0" />
+ </method>
+ <method name="Average"
signature="Average<TSource>(System.Collections.Generic.IEnumerable<TSource>
source,System.Func<TSource,System.Decimal> selector) : System.Decimal
[static]" excluded="false" instrumented="true" cc="0" vc="1" nid="0">
+ <seqpnt vc="1" o="1" l="852" el="852" c="13" ec="54" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="1" o="10" l="853" el="853" c="9" ec="10" ex="false"
fl="65536" doc="2" nid="0" />
+ </method>
+ <method name="Average"
signature="Average<TSource>(System.Collections.Generic.IEnumerable<TSource>
source,System.Func<TSource,System.Double> selector) : System.Double
[static]" excluded="false" instrumented="true" cc="0" vc="1" nid="0">
+ <seqpnt vc="1" o="1" l="666" el="666" c="13" ec="54" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="1" o="10" l="667" el="667" c="9" ec="10" ex="false"
fl="65536" doc="2" nid="0" />
+ </method>
+ <method name="Average"
signature="Average<TSource>(System.Collections.Generic.IEnumerable<TSource>
source,System.Func<TSource,System.Int32> selector) : System.Double
[static]" excluded="false" instrumented="true" cc="0" vc="1" nid="0">
+ <seqpnt vc="1" o="1" l="108" el="108" c="13" ec="54" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="1" o="10" l="109" el="109" c="9" ec="10" ex="false"
fl="65536" doc="2" nid="0" />
+ </method>
+ <method name="Average"
signature="Average<TSource>(System.Collections.Generic.IEnumerable<TSource>
source,System.Func<TSource,System.Int64> selector) : System.Double
[static]" excluded="false" instrumented="true" cc="0" vc="1" nid="0">
+ <seqpnt vc="1" o="1" l="294" el="294" c="13" ec="54" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="1" o="10" l="295" el="295" c="9" ec="10" ex="false"
fl="65536" doc="2" nid="0" />
+ </method>
+ <method name="Average"
signature="Average<TSource>(System.Collections.Generic.IEnumerable<TSource>
source,System.Func<TSource,System.Nullable<System.Decimal>>
selector) : System.Nullable<System.Decimal> [static]"
excluded="false" instrumented="true" cc="0" vc="1" nid="0">
+ <seqpnt vc="1" o="1" l="920" el="920" c="13" ec="54" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="1" o="10" l="921" el="921" c="9" ec="10" ex="false"
fl="65536" doc="2" nid="0" />
+ </method>
+ <method name="Average"
signature="Average<TSource>(System.Collections.Generic.IEnumerable<TSource>
source,System.Func<TSource,System.Nullable<System.Double>>
selector) : System.Nullable<System.Double> [static]" excluded="false"
instrumented="true" cc="0" vc="1" nid="0">
+ <seqpnt vc="1" o="1" l="734" el="734" c="13" ec="54" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="1" o="10" l="735" el="735" c="9" ec="10" ex="false"
fl="65536" doc="2" nid="0" />
+ </method>
+ <method name="Average"
signature="Average<TSource>(System.Collections.Generic.IEnumerable<TSource>
source,System.Func<TSource,System.Nullable<System.Int32>>
selector) : System.Nullable<System.Double> [static]" excluded="false"
instrumented="true" cc="0" vc="1" nid="0">
+ <seqpnt vc="1" o="1" l="176" el="176" c="13" ec="54" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="1" o="10" l="177" el="177" c="9" ec="10" ex="false"
fl="65536" doc="2" nid="0" />
+ </method>
+ <method name="Average"
signature="Average<TSource>(System.Collections.Generic.IEnumerable<TSource>
source,System.Func<TSource,System.Nullable<System.Int64>>
selector) : System.Nullable<System.Double> [static]" excluded="false"
instrumented="true" cc="0" vc="1" nid="0">
+ <seqpnt vc="1" o="1" l="362" el="362" c="13" ec="54" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="1" o="10" l="363" el="363" c="9" ec="10" ex="false"
fl="65536" doc="2" nid="0" />
+ </method>
+ <method name="Average"
signature="Average<TSource>(System.Collections.Generic.IEnumerable<TSource>
source,System.Func<TSource,System.Nullable<System.Single>>
selector) : System.Nullable<System.Single> [static]" excluded="false"
instrumented="true" cc="0" vc="1" nid="0">
+ <seqpnt vc="1" o="1" l="548" el="548" c="13" ec="54" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="1" o="10" l="549" el="549" c="9" ec="10" ex="false"
fl="65536" doc="2" nid="0" />
+ </method>
+ <method name="Average"
signature="Average<TSource>(System.Collections.Generic.IEnumerable<TSource>
source,System.Func<TSource,System.Single> selector) : System.Single
[static]" excluded="false" instrumented="true" cc="0" vc="1" nid="0">
+ <seqpnt vc="1" o="1" l="480" el="480" c="13" ec="54" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="1" o="10" l="481" el="481" c="9" ec="10" ex="false"
fl="65536" doc="2" nid="0" />
+ </method>
+ <method name="Cast"
signature="Cast<TResult>(System.Collections.IEnumerable source) :
System.Collections.Generic.IEnumerable<TResult> [static]"
excluded="false" instrumented="true" cc="0" vc="3" nid="0">
+ <seqpnt vc="4" o="1" l="76" el="76" c="13" ec="44" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="3" o="D" l="78" el="78" c="13" ec="47" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="3" o="16" l="79" el="79" c="9" ec="10" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="CastYield"
signature="CastYield<TResult>(System.Collections.IEnumerable
source) : System.Collections.Generic.IEnumerable<TResult> [static]"
excluded="false" instrumented="false" cc="0" vc="0" nid="0" />
+ <method name="CheckNotNull" signature="CheckNotNull<T>(T
value,System.String name) : void [static]" excluded="false"
instrumented="true" cc="0" vc="26" nid="0">
+ <seqpnt vc="961" o="1" l="1742" el="1742" c="13" ec="31"
ex="false" fl="65536" doc="3" nid="0" />
+ <seqpnt vc="26" o="11" l="1743" el="1743" c="17" ec="55"
ex="false" fl="65536" doc="3" nid="0" />
+ <seqpnt vc="935" o="18" l="1744" el="1744" c="9" ec="10"
ex="false" fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="Concat"
signature="Concat<TSource>(System.Collections.Generic.IEnumerable<TSource>
first,System.Collections.Generic.IEnumerable<TSource> second) :
System.Collections.Generic.IEnumerable<TSource> [static]"
excluded="false" instrumented="true" cc="0" vc="3" nid="0">
+ <seqpnt vc="6" o="1" l="762" el="762" c="13" ec="42" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="5" o="D" l="763" el="763" c="13" ec="44" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="3" o="19" l="765" el="765" c="13" ec="47" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="3" o="23" l="766" el="766" c="9" ec="10" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="ConcatYield"
signature="ConcatYield<TSource>(System.Collections.Generic.IEnumerable<TSource>
first,System.Collections.Generic.IEnumerable<TSource> second) :
System.Collections.Generic.IEnumerable<TSource> [static]"
excluded="false" instrumented="false" cc="0" vc="0" nid="0" />
+ <method name="Contains"
signature="Contains<TSource>(System.Collections.Generic.IEnumerable<TSource>
source,TSource value) : System.Boolean [static]" excluded="false"
instrumented="true" cc="0" vc="3" nid="0">
+ <seqpnt vc="3" o="1" l="1223" el="1223" c="13" ec="64" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="3" o="C" l="1224" el="1224" c="9" ec="10" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="Contains"
signature="Contains<TSource>(System.Collections.Generic.IEnumerable<TSource>
source,TSource
value,System.Collections.Generic.IEqualityComparer<TSource>
comparer) : System.Boolean [static]" excluded="false" instrumented="true"
cc="0" vc="1" nid="0">
+ <seqpnt vc="3" o="15" l="1236" el="1236" c="13" ec="44" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="3" o="21" l="1238" el="1238" c="13" ec="34" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="3" o="32" l="1240" el="1240" c="17" ec="65" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="3" o="39" l="1241" el="1241" c="17" ec="40" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="1" o="41" l="1242" el="1242" c="21" ec="55" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="2" o="51" l="1245" el="1245" c="13" ec="70" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="2" o="66" l="1246" el="1246" c="13" ec="69" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="3" o="7B" l="1247" el="1247" c="9" ec="10" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="Count"
signature="Count<TSource>(System.Collections.Generic.IEnumerable<TSource>
source) : System.Int32 [static]" excluded="false" instrumented="true"
cc="0" vc="2" nid="0">
+ <seqpnt vc="2" o="1" l="706" el="706" c="13" ec="44" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="2" o="D" l="708" el="708" c="13" ec="52" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="2" o="14" l="709" el="711" c="13" ec="77" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="2" o="35" l="712" el="712" c="9" ec="10" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="Count"
signature="Count<TSource>(System.Collections.Generic.IEnumerable<TSource>
source,System.Func<TSource,System.Boolean> predicate) : System.Int32
[static]" excluded="false" instrumented="true" cc="0" vc="1" nid="0">
+ <seqpnt vc="1" o="1" l="723" el="723" c="13" ec="51" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="1" o="10" l="724" el="724" c="9" ec="10" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="DefaultIfEmpty"
signature="DefaultIfEmpty<TSource>(System.Collections.Generic.IEnumerable<TSource>
source) : System.Collections.Generic.IEnumerable<TSource> [static]"
excluded="false" instrumented="true" cc="0" vc="1" nid="0">
+ <seqpnt vc="1" o="1" l="1141" el="1141" c="13" ec="60" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="1" o="13" l="1142" el="1142" c="9" ec="10" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="DefaultIfEmpty"
signature="DefaultIfEmpty<TSource>(System.Collections.Generic.IEnumerable<TSource>
source,TSource defaultValue) :
System.Collections.Generic.IEnumerable<TSource> [static]"
excluded="false" instrumented="true" cc="0" vc="4" nid="0">
+ <seqpnt vc="4" o="1" l="1153" el="1153" c="13" ec="44" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="4" o="D" l="1155" el="1155" c="13" ec="62" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="4" o="17" l="1156" el="1156" c="9" ec="10" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="DefaultIfEmptyYield"
signature="DefaultIfEmptyYield<TSource>(System.Collections.Generic.IEnumerable<TSource>
source,TSource defaultValue) :
System.Collections.Generic.IEnumerable<TSource> [static]"
excluded="false" instrumented="false" cc="0" vc="0" nid="0" />
+ <method name="Distinct"
signature="Distinct<TSource>(System.Collections.Generic.IEnumerable<TSource>
source) : System.Collections.Generic.IEnumerable<TSource> [static]"
excluded="false" instrumented="true" cc="0" vc="1" nid="0">
+ <seqpnt vc="2" o="1" l="809" el="809" c="13" ec="58" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="1" o="B" l="810" el="810" c="9" ec="10" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="Distinct"
signature="Distinct<TSource>(System.Collections.Generic.IEnumerable<TSource>
source,System.Collections.Generic.IEqualityComparer<TSource>
comparer) : System.Collections.Generic.IEnumerable<TSource> [static]"
excluded="false" instrumented="true" cc="0" vc="4" nid="0">
+ <seqpnt vc="5" o="1" l="821" el="821" c="13" ec="44" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="4" o="D" l="823" el="823" c="13" ec="52" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="4" o="17" l="824" el="824" c="9" ec="10" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="DistinctYield"
signature="DistinctYield<TSource>(System.Collections.Generic.IEnumerable<TSource>
source,System.Collections.Generic.IEqualityComparer<TSource>
comparer) : System.Collections.Generic.IEnumerable<TSource> [static]"
excluded="false" instrumented="false" cc="0" vc="0" nid="0" />
+ <method name="ElementAt"
signature="ElementAt<TSource>(System.Collections.Generic.IEnumerable<TSource>
source,System.Int32 index) : TSource [static]" excluded="false"
instrumented="true" cc="0" vc="1" nid="0">
+ <seqpnt vc="7" o="10" l="564" el="564" c="13" ec="44" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="7" o="1C" l="566" el="566" c="13" ec="27" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="1" o="2E" l="567" el="567" c="17" ec="77" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="6" o="45" l="569" el="569" c="13" ec="49" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="6" o="4C" l="570" el="570" c="13" ec="30" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="1" o="56" l="571" el="571" c="17" ec="36" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="5" o="66" l="575" el="575" c="17" ec="73" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="1" o="87" l="577" el="577" c="13" ec="46" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="1" o="89" l="579" el="579" c="17" ec="77" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="5" o="A1" l="581" el="581" c="9" ec="10" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="ElementAtOrDefault"
signature="ElementAtOrDefault<TSource>(System.Collections.Generic.IEnumerable<TSource>
source,System.Int32 index) : TSource [static]" excluded="false"
instrumented="true" cc="0" vc="1" nid="0">
+ <seqpnt vc="5" o="E" l="592" el="592" c="13" ec="44" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="5" o="1A" l="594" el="594" c="13" ec="27" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="1" o="2A" l="595" el="595" c="17" ec="41" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="4" o="37" l="597" el="597" c="13" ec="49" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="4" o="3E" l="598" el="598" c="13" ec="30" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="1" o="46" l="599" el="599" c="17" ec="76" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="3" o="6F" l="601" el="601" c="13" ec="78" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="5" o="89" l="602" el="602" c="9" ec="10" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="Empty" signature="Empty<TResult>() :
System.Collections.Generic.IEnumerable<TResult> [static]"
excluded="false" instrumented="true" cc="0" vc="5" nid="0">
+ <seqpnt vc="5" o="1" l="65" el="65" c="13" ec="44" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="5" o="9" l="66" el="66" c="9" ec="10" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="Except"
signature="Except<TSource>(System.Collections.Generic.IEnumerable<TSource>
first,System.Collections.Generic.IEnumerable<TSource> second) :
System.Collections.Generic.IEnumerable<TSource> [static]"
excluded="false" instrumented="true" cc="0" vc="1" nid="0">
+ <seqpnt vc="2" o="1" l="1560" el="1560" c="13" ec="62" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="1" o="C" l="1561" el="1561" c="9" ec="10" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="Except"
signature="Except<TSource>(System.Collections.Generic.IEnumerable<TSource>
first,System.Collections.Generic.IEnumerable<TSource>
second,System.Collections.Generic.IEqualityComparer<TSource>
comparer) : System.Collections.Generic.IEnumerable<TSource> [static]"
excluded="false" instrumented="true" cc="0" vc="2" nid="0">
+ <seqpnt vc="3" o="1" l="1573" el="1573" c="13" ec="83" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="2" o="D" l="1574" el="1574" c="9" ec="10" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="First"
signature="First<TSource>(System.Collections.Generic.IEnumerable<TSource>
source) : TSource [static]" excluded="false" instrumented="true" cc="0"
vc="7" nid="0">
+ <seqpnt vc="10" o="1" l="373" el="373" c="13" ec="65" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="7" o="F" l="374" el="374" c="9" ec="10" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="First"
signature="First<TSource>(System.Collections.Generic.IEnumerable<TSource>
source,System.Func<TSource,System.Boolean> predicate) : TSource
[static]" excluded="false" instrumented="true" cc="0" vc="1" nid="0">
+ <seqpnt vc="2" o="1" l="384" el="384" c="13" ec="51" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="1" o="10" l="385" el="385" c="9" ec="10" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="FirstImpl"
signature="FirstImpl<TSource>(System.Collections.Generic.IEnumerable<TSource>
source,System.Func<TSource> empty) : TSource [static]"
excluded="false" instrumented="true" cc="0" vc="1" nid="0">
+ <seqpnt vc="17" o="1" l="355" el="355" c="13" ec="44" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="17" o="D" l="356" el="356" c="13" ec="41" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="17" o="1A" l="358" el="358" c="13" ec="49" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="17" o="21" l="359" el="359" c="13" ec="30" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="1" o="29" l="360" el="360" c="17" ec="59" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="16" o="44" l="362" el="362" c="20" ec="50" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="16" o="4B" l="363" el="363" c="17" ec="59" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="14" o="75" l="364" el="364" c="9" ec="10" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="FirstOrDefault"
signature="FirstOrDefault<TSource>(System.Collections.Generic.IEnumerable<TSource>
source) : TSource [static]" excluded="false" instrumented="true" cc="0"
vc="7" nid="0">
+ <seqpnt vc="7" o="1" l="395" el="395" c="13" ec="63" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="7" o="F" l="396" el="396" c="9" ec="10" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="FirstOrDefault"
signature="FirstOrDefault<TSource>(System.Collections.Generic.IEnumerable<TSource>
source,System.Func<TSource,System.Boolean> predicate) : TSource
[static]" excluded="false" instrumented="true" cc="0" vc="2" nid="0">
+ <seqpnt vc="3" o="1" l="407" el="407" c="13" ec="60" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="2" o="10" l="408" el="408" c="9" ec="10" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="GroupBy"
signature="GroupBy<TSource,TKey,TElement,TResult>(System.Collections.Generic.IEnumerable<TSource>
source,System.Func<TSource,TKey>
keySelector,System.Func<TSource,TElement>
elementSelector,System.Func<TKey,System.Collections.Generic.IEnumerable<TElement>,TResult>
resultSelector) : System.Collections.Generic.IEnumerable<TResult>
[static]" excluded="false" instrumented="true" cc="0" vc="1" nid="0">
+ <seqpnt vc="1" o="1" l="1023" el="1023" c="13" ec="103" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="1" o="E" l="1024" el="1024" c="9" ec="10" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="GroupBy"
signature="GroupBy<TSource,TKey,TElement,TResult>(System.Collections.Generic.IEnumerable<TSource>
source,System.Func<TSource,TKey>
keySelector,System.Func<TSource,TElement>
elementSelector,System.Func<TKey,System.Collections.Generic.IEnumerable<TElement>,TResult>
resultSelector,System.Collections.Generic.IEqualityComparer<TKey>
comparer) : System.Collections.Generic.IEnumerable<TResult> [static]"
excluded="false" instrumented="true" cc="0" vc="2" nid="0">
+ <seqpnt vc="2" o="E" l="1041" el="1041" c="13" ec="44" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="2" o="1A" l="1042" el="1042" c="13" ec="54" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="2" o="26" l="1043" el="1043" c="13" ec="62" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="2" o="32" l="1044" el="1044" c="13" ec="60" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="2" o="43" l="1046" el="1047" c="13" ec="59" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="2" o="61" l="1048" el="1048" c="9" ec="10" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="GroupBy"
signature="GroupBy<TSource,TKey,TElement>(System.Collections.Generic.IEnumerable<TSource>
source,System.Func<TSource,TKey>
keySelector,System.Func<TSource,TElement> elementSelector) :
System.Collections.Generic.IEnumerable<System.Linq.IGrouping<TKey,TElement>>
[static]" excluded="false" instrumented="true" cc="0" vc="1" nid="0">
+ <seqpnt vc="1" o="1" l="955" el="955" c="13" ec="87" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="1" o="D" l="956" el="956" c="9" ec="10" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="GroupBy"
signature="GroupBy<TSource,TKey,TElement>(System.Collections.Generic.IEnumerable<TSource>
source,System.Func<TSource,TKey>
keySelector,System.Func<TSource,TElement>
elementSelector,System.Collections.Generic.IEqualityComparer<TKey>
comparer) :
System.Collections.Generic.IEnumerable<System.Linq.IGrouping<TKey,TElement>>
[static]" excluded="false" instrumented="true" cc="0" vc="5" nid="0">
+ <seqpnt vc="6" o="1" l="970" el="970" c="13" ec="44" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="6" o="D" l="971" el="971" c="13" ec="54" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="5" o="19" l="972" el="972" c="13" ec="62" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="5" o="25" l="974" el="974" c="13" ec="77" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="5" o="31" l="975" el="975" c="9" ec="10" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="GroupBy"
signature="GroupBy<TSource,TKey,TResult>(System.Collections.Generic.IEnumerable<TSource>
source,System.Func<TSource,TKey>
keySelector,System.Func<TKey,System.Collections.Generic.IEnumerable<TSource>,TResult>
resultSelector) : System.Collections.Generic.IEnumerable<TResult>
[static]" excluded="false" instrumented="true" cc="0" vc="1" nid="0">
+ <seqpnt vc="1" o="1" l="988" el="988" c="13" ec="86" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="1" o="D" l="989" el="989" c="9" ec="10" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="GroupBy"
signature="GroupBy<TSource,TKey,TResult>(System.Collections.Generic.IEnumerable<TSource>
source,System.Func<TSource,TKey>
keySelector,System.Func<TKey,System.Collections.Generic.IEnumerable<TSource>,TResult>
resultSelector,System.Collections.Generic.IEqualityComparer<TKey>
comparer) : System.Collections.Generic.IEnumerable<TResult> [static]"
excluded="false" instrumented="true" cc="0" vc="2" nid="0">
+ <seqpnt vc="2" o="E" l="1004" el="1004" c="13" ec="44" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="2" o="1A" l="1005" el="1005" c="13" ec="54" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="2" o="26" l="1006" el="1006" c="13" ec="60" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="2" o="37" l="1008" el="1008" c="13" ec="98" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="2" o="53" l="1009" el="1009" c="9" ec="10" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="GroupBy"
signature="GroupBy<TSource,TKey>(System.Collections.Generic.IEnumerable<TSource>
source,System.Func<TSource,TKey> keySelector) :
System.Collections.Generic.IEnumerable<System.Linq.IGrouping<TKey,TSource>>
[static]" excluded="false" instrumented="true" cc="0" vc="2" nid="0">
+ <seqpnt vc="3" o="1" l="927" el="927" c="13" ec="70" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="2" o="C" l="928" el="928" c="9" ec="10" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="GroupBy"
signature="GroupBy<TSource,TKey>(System.Collections.Generic.IEnumerable<TSource>
source,System.Func<TSource,TKey>
keySelector,System.Collections.Generic.IEqualityComparer<TKey>
comparer) :
System.Collections.Generic.IEnumerable<System.Linq.IGrouping<TKey,TSource>>
[static]" excluded="false" instrumented="true" cc="0" vc="3" nid="0">
+ <seqpnt vc="4" o="1" l="941" el="941" c="13" ec="67" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="3" o="18" l="942" el="942" c="9" ec="10" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="GroupJoin"
signature="GroupJoin<TOuter,TInner,TKey,TResult>(System.Collections.Generic.IEnumerable<TOuter>
outer,System.Collections.Generic.IEnumerable<TInner>
inner,System.Func<TOuter,TKey>
outerKeySelector,System.Func<TInner,TKey>
innerKeySelector,System.Func<TOuter,System.Collections.Generic.IEnumerable<TInner>,TResult>
resultSelector) : System.Collections.Generic.IEnumerable<TResult>
[static]" excluded="false" instrumented="true" cc="0" vc="1" nid="0">
+ <seqpnt vc="2" o="1" l="1711" el="1711" c="13" ec="116" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="1" o="10" l="1712" el="1712" c="9" ec="10" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="GroupJoin"
signature="GroupJoin<TOuter,TInner,TKey,TResult>(System.Collections.Generic.IEnumerable<TOuter>
outer,System.Collections.Generic.IEnumerable<TInner>
inner,System.Func<TOuter,TKey>
outerKeySelector,System.Func<TInner,TKey>
innerKeySelector,System.Func<TOuter,System.Collections.Generic.IEnumerable<TInner>,TResult>
resultSelector,System.Collections.Generic.IEqualityComparer<TKey>
comparer) : System.Collections.Generic.IEnumerable<TResult> [static]"
excluded="false" instrumented="true" cc="0" vc="2" nid="0">
+ <seqpnt vc="3" o="16" l="1729" el="1729" c="13" ec="42" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="3" o="22" l="1730" el="1730" c="13" ec="42" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="3" o="2E" l="1731" el="1731" c="13" ec="64" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="2" o="3F" l="1732" el="1732" c="13" ec="64" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="2" o="4B" l="1733" el="1733" c="13" ec="60" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="2" o="5C" l="1735" el="1735" c="13" ec="69" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="2" o="6B" l="1736" el="1736" c="13" ec="86" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="2" o="80" l="1737" el="1737" c="9" ec="10" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="Intersect"
signature="Intersect<TSource>(System.Collections.Generic.IEnumerable<TSource>
first,System.Collections.Generic.IEnumerable<TSource> second) :
System.Collections.Generic.IEnumerable<TSource> [static]"
excluded="false" instrumented="true" cc="0" vc="1" nid="0">
+ <seqpnt vc="2" o="1" l="1535" el="1535" c="13" ec="65" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="1" o="C" l="1536" el="1536" c="9" ec="10" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="Intersect"
signature="Intersect<TSource>(System.Collections.Generic.IEnumerable<TSource>
first,System.Collections.Generic.IEnumerable<TSource>
second,System.Collections.Generic.IEqualityComparer<TSource>
comparer) : System.Collections.Generic.IEnumerable<TSource> [static]"
excluded="false" instrumented="true" cc="0" vc="2" nid="0">
+ <seqpnt vc="3" o="1" l="1548" el="1548" c="13" ec="82" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="2" o="D" l="1549" el="1549" c="9" ec="10" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="IntersectExceptImpl"
signature="IntersectExceptImpl<TSource>(System.Collections.Generic.IEnumerable<TSource>
first,System.Collections.Generic.IEnumerable<TSource>
second,System.Collections.Generic.IEqualityComparer<TSource>
comparer,System.Boolean flag) :
System.Collections.Generic.IEnumerable<TSource> [static]"
excluded="false" instrumented="true" cc="0" vc="4" nid="0">
+ <seqpnt vc="6" o="7" l="1503" el="1503" c="13" ec="42" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="6" o="13" l="1504" el="1504" c="13" ec="44" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="4" o="1F" l="1506" el="1506" c="13" ec="44" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="4" o="25" l="1507" el="1507" c="13" ec="65" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="4" o="32" l="1509" el="1509" c="34" ec="73" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="19" o="4D" l="1509" el="1509" c="22" ec="30"
ex="false" fl="65536" doc="3" nid="0" />
+ <seqpnt vc="19" o="56" l="1511" el="1511" c="17" ec="40"
ex="false" fl="65536" doc="3" nid="0" />
+ <seqpnt vc="19" o="67" l="1512" el="1512" c="17" ec="32"
ex="false" fl="65536" doc="3" nid="0" />
+ <seqpnt vc="23" o="70" l="1509" el="1509" c="31" ec="33"
ex="false" fl="65536" doc="3" nid="0" />
+ <seqpnt vc="4" o="95" l="1515" el="1515" c="34" ec="65" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="10" o="B5" l="1515" el="1515" c="22" ec="30"
ex="false" fl="65536" doc="3" nid="0" />
+ <seqpnt vc="10" o="BD" l="1516" el="1516" c="17" ec="36"
ex="false" fl="65536" doc="3" nid="0" />
+ <seqpnt vc="14" o="CB" l="1515" el="1515" c="31" ec="33"
ex="false" fl="65536" doc="3" nid="0" />
+ <seqpnt vc="4" o="EF" l="1523" el="1523" c="13" ec="52" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="4" o="104" l="1524" el="1524" c="9" ec="10" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="Join"
signature="Join<TOuter,TInner,TKey,TResult>(System.Collections.Generic.IEnumerable<TOuter>
outer,System.Collections.Generic.IEnumerable<TInner>
inner,System.Func<TOuter,TKey>
outerKeySelector,System.Func<TInner,TKey>
innerKeySelector,System.Func<TOuter,TInner,TResult> resultSelector) :
System.Collections.Generic.IEnumerable<TResult> [static]"
excluded="false" instrumented="true" cc="0" vc="1" nid="0">
+ <seqpnt vc="2" o="1" l="1667" el="1667" c="13" ec="111" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="1" o="10" l="1668" el="1668" c="9" ec="10" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="Join"
signature="Join<TOuter,TInner,TKey,TResult>(System.Collections.Generic.IEnumerable<TOuter>
outer,System.Collections.Generic.IEnumerable<TInner>
inner,System.Func<TOuter,TKey>
outerKeySelector,System.Func<TInner,TKey>
innerKeySelector,System.Func<TOuter,TInner,TResult>
resultSelector,System.Collections.Generic.IEqualityComparer<TKey>
comparer) : System.Collections.Generic.IEnumerable<TResult> [static]"
excluded="false" instrumented="true" cc="0" vc="2" nid="0">
+ <seqpnt vc="3" o="16" l="1684" el="1684" c="13" ec="42" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="3" o="22" l="1685" el="1685" c="13" ec="42" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="2" o="2E" l="1686" el="1686" c="13" ec="64" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="2" o="3F" l="1687" el="1687" c="13" ec="64" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="2" o="4B" l="1688" el="1688" c="13" ec="60" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="2" o="5C" l="1690" el="1690" c="13" ec="69" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="2" o="6B" l="1692" el="1695" c="13" ec="45" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="2" o="8C" l="1696" el="1696" c="9" ec="10" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="Last"
signature="Last<TSource>(System.Collections.Generic.IEnumerable<TSource>
source) : TSource [static]" excluded="false" instrumented="true" cc="0"
vc="7" nid="0">
+ <seqpnt vc="9" o="1" l="443" el="443" c="13" ec="64" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="7" o="F" l="444" el="444" c="9" ec="10" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="Last"
signature="Last<TSource>(System.Collections.Generic.IEnumerable<TSource>
source,System.Func<TSource,System.Boolean> predicate) : TSource
[static]" excluded="false" instrumented="true" cc="0" vc="1" nid="0">
+ <seqpnt vc="3" o="1" l="455" el="455" c="13" ec="50" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="1" o="10" l="456" el="456" c="9" ec="10" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="LastImpl"
signature="LastImpl<TSource>(System.Collections.Generic.IEnumerable<TSource>
source,System.Func<TSource> empty) : TSource [static]"
excluded="false" instrumented="true" cc="0" vc="2" nid="0">
+ <seqpnt vc="13" o="1" l="418" el="418" c="13" ec="44" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="13" o="D" l="420" el="420" c="13" ec="49" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="13" o="14" l="421" el="421" c="13" ec="30" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="2" o="1E" l="422" el="422" c="17" ec="72" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="11" o="40" l="424" el="424" c="20" ec="50" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="11" o="48" l="426" el="426" c="17" ec="35" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="3" o="54" l="427" el="427" c="21" ec="36" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="8" o="5D" l="429" el="429" c="17" ec="38" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="20" o="66" l="431" el="431" c="21" ec="38" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="28" o="6D" l="430" el="430" c="17" ec="37" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="8" o="79" l="433" el="433" c="17" ec="29" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="11" o="90" l="435" el="435" c="9" ec="10" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="LastOrDefault"
signature="LastOrDefault<TSource>(System.Collections.Generic.IEnumerable<TSource>
source) : TSource [static]" excluded="false" instrumented="true" cc="0"
vc="4" nid="0">
+ <seqpnt vc="4" o="1" l="466" el="466" c="13" ec="62" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="4" o="F" l="467" el="467" c="9" ec="10" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="LastOrDefault"
signature="LastOrDefault<TSource>(System.Collections.Generic.IEnumerable<TSource>
source,System.Func<TSource,System.Boolean> predicate) : TSource
[static]" excluded="false" instrumented="true" cc="0" vc="2" nid="0">
+ <seqpnt vc="2" o="1" l="478" el="478" c="13" ec="59" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="2" o="10" l="479" el="479" c="9" ec="10" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="LongCount"
signature="LongCount<TSource>(System.Collections.Generic.IEnumerable<TSource>
source) : System.Int64 [static]" excluded="false" instrumented="true"
cc="0" vc="2" nid="0">
+ <seqpnt vc="2" o="1" l="734" el="734" c="13" ec="44" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="2" o="D" l="736" el="736" c="13" ec="41" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="2" o="14" l="737" el="739" c="13" ec="69" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="2" o="36" l="740" el="740" c="9" ec="10" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="LongCount"
signature="LongCount<TSource>(System.Collections.Generic.IEnumerable<TSource>
source,System.Func<TSource,System.Boolean> predicate) : System.Int64
[static]" excluded="false" instrumented="true" cc="0" vc="1" nid="0">
+ <seqpnt vc="2" o="1" l="751" el="751" c="13" ec="55" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="1" o="10" l="752" el="752" c="9" ec="10" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="Max"
signature="Max(System.Collections.Generic.IEnumerable<System.Nullable<System.Decimal>>
source) : System.Nullable<System.Decimal> [static]" excluded="false"
instrumented="true" cc="0" vc="2" nid="0">
+ <seqpnt vc="2" o="1" l="956" el="956" c="13" ec="44" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="2" o="D" l="958" el="959" c="13" ec="86" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="2" o="62" l="960" el="960" c="9" ec="10" ex="false"
fl="65536" doc="2" nid="0" />
+ </method>
+ <method name="Max"
signature="Max(System.Collections.Generic.IEnumerable<System.Nullable<System.Double>>
source) : System.Nullable<System.Double> [static]" excluded="false"
instrumented="true" cc="0" vc="2" nid="0">
+ <seqpnt vc="2" o="1" l="770" el="770" c="13" ec="44" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="2" o="D" l="772" el="773" c="13" ec="86" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="2" o="62" l="774" el="774" c="9" ec="10" ex="false"
fl="65536" doc="2" nid="0" />
+ </method>
+ <method name="Max"
signature="Max(System.Collections.Generic.IEnumerable<System.Nullable<System.Int32>>
source) : System.Nullable<System.Int32> [static]" excluded="false"
instrumented="true" cc="0" vc="5" nid="0">
+ <seqpnt vc="5" o="1" l="212" el="212" c="13" ec="44" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="5" o="D" l="214" el="215" c="13" ec="86" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="5" o="62" l="216" el="216" c="9" ec="10" ex="false"
fl="65536" doc="2" nid="0" />
+ </method>
+ <method name="Max"
signature="Max(System.Collections.Generic.IEnumerable<System.Nullable<System.Int64>>
source) : System.Nullable<System.Int64> [static]" excluded="false"
instrumented="true" cc="0" vc="2" nid="0">
+ <seqpnt vc="2" o="1" l="398" el="398" c="13" ec="44" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="2" o="D" l="400" el="401" c="13" ec="86" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="2" o="62" l="402" el="402" c="9" ec="10" ex="false"
fl="65536" doc="2" nid="0" />
+ </method>
+ <method name="Max"
signature="Max(System.Collections.Generic.IEnumerable<System.Nullable<System.Single>>
source) : System.Nullable<System.Single> [static]" excluded="false"
instrumented="true" cc="0" vc="2" nid="0">
+ <seqpnt vc="2" o="1" l="584" el="584" c="13" ec="44" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="2" o="D" l="586" el="587" c="13" ec="86" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="2" o="62" l="588" el="588" c="9" ec="10" ex="false"
fl="65536" doc="2" nid="0" />
+ </method>
+ <method name="Max"
signature="Max<TSource,TResult>(System.Collections.Generic.IEnumerable<TSource>
source,System.Func<TSource,TResult> selector) : TResult [static]"
excluded="false" instrumented="true" cc="0" vc="1" nid="0">
+ <seqpnt vc="1" o="1" l="1365" el="1365" c="13" ec="50" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="1" o="10" l="1366" el="1366" c="9" ec="10" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="Max"
signature="Max<TSource>(System.Collections.Generic.IEnumerable<TSource>
source) : TSource [static]" excluded="false" instrumented="true" cc="0"
vc="2" nid="0">
+ <seqpnt vc="3" o="7" l="1352" el="1352" c="13" ec="54" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="3" o="12" l="1353" el="1353" c="13" ec="76" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="2" o="27" l="1354" el="1354" c="9" ec="10" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="Max"
signature="Max<TSource>(System.Collections.Generic.IEnumerable<TSource>
source,System.Func<TSource,System.Nullable<System.Decimal>>
selector) : System.Nullable<System.Decimal> [static]"
excluded="false" instrumented="true" cc="0" vc="1" nid="0">
+ <seqpnt vc="1" o="1" l="971" el="971" c="13" ec="50" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="1" o="10" l="972" el="972" c="9" ec="10" ex="false"
fl="65536" doc="2" nid="0" />
+ </method>
+ <method name="Max"
signature="Max<TSource>(System.Collections.Generic.IEnumerable<TSource>
source,System.Func<TSource,System.Nullable<System.Double>>
selector) : System.Nullable<System.Double> [static]" excluded="false"
instrumented="true" cc="0" vc="1" nid="0">
+ <seqpnt vc="1" o="1" l="785" el="785" c="13" ec="50" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="1" o="10" l="786" el="786" c="9" ec="10" ex="false"
fl="65536" doc="2" nid="0" />
+ </method>
+ <method name="Max"
signature="Max<TSource>(System.Collections.Generic.IEnumerable<TSource>
source,System.Func<TSource,System.Nullable<System.Int32>>
selector) : System.Nullable<System.Int32> [static]" excluded="false"
instrumented="true" cc="0" vc="1" nid="0">
+ <seqpnt vc="1" o="1" l="227" el="227" c="13" ec="50" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="1" o="10" l="228" el="228" c="9" ec="10" ex="false"
fl="65536" doc="2" nid="0" />
+ </method>
+ <method name="Max"
signature="Max<TSource>(System.Collections.Generic.IEnumerable<TSource>
source,System.Func<TSource,System.Nullable<System.Int64>>
selector) : System.Nullable<System.Int64> [static]" excluded="false"
instrumented="true" cc="0" vc="1" nid="0">
+ <seqpnt vc="1" o="1" l="413" el="413" c="13" ec="50" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="1" o="10" l="414" el="414" c="9" ec="10" ex="false"
fl="65536" doc="2" nid="0" />
+ </method>
+ <method name="Max"
signature="Max<TSource>(System.Collections.Generic.IEnumerable<TSource>
source,System.Func<TSource,System.Nullable<System.Single>>
selector) : System.Nullable<System.Single> [static]" excluded="false"
instrumented="true" cc="0" vc="1" nid="0">
+ <seqpnt vc="1" o="1" l="599" el="599" c="13" ec="50" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="1" o="10" l="600" el="600" c="9" ec="10" ex="false"
fl="65536" doc="2" nid="0" />
+ </method>
+ <method name="Min"
signature="Min(System.Collections.Generic.IEnumerable<System.Nullable<System.Decimal>>
source) : System.Nullable<System.Decimal> [static]" excluded="false"
instrumented="true" cc="0" vc="2" nid="0">
+ <seqpnt vc="2" o="1" l="931" el="931" c="13" ec="44" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="2" o="D" l="933" el="933" c="13" ec="88" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="2" o="62" l="934" el="934" c="9" ec="10" ex="false"
fl="65536" doc="2" nid="0" />
+ </method>
+ <method name="Min"
signature="Min(System.Collections.Generic.IEnumerable<System.Nullable<System.Double>>
source) : System.Nullable<System.Double> [static]" excluded="false"
instrumented="true" cc="0" vc="2" nid="0">
+ <seqpnt vc="2" o="1" l="745" el="745" c="13" ec="44" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="2" o="D" l="747" el="747" c="13" ec="88" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="2" o="62" l="748" el="748" c="9" ec="10" ex="false"
fl="65536" doc="2" nid="0" />
+ </method>
+ <method name="Min"
signature="Min(System.Collections.Generic.IEnumerable<System.Nullable<System.Int32>>
source) : System.Nullable<System.Int32> [static]" excluded="false"
instrumented="true" cc="0" vc="2" nid="0">
+ <seqpnt vc="2" o="1" l="187" el="187" c="13" ec="44" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="2" o="D" l="189" el="189" c="13" ec="88" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="2" o="62" l="190" el="190" c="9" ec="10" ex="false"
fl="65536" doc="2" nid="0" />
+ </method>
+ <method name="Min"
signature="Min(System.Collections.Generic.IEnumerable<System.Nullable<System.Int64>>
source) : System.Nullable<System.Int64> [static]" excluded="false"
instrumented="true" cc="0" vc="3" nid="0">
+ <seqpnt vc="3" o="1" l="373" el="373" c="13" ec="44" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="3" o="D" l="375" el="375" c="13" ec="88" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="3" o="62" l="376" el="376" c="9" ec="10" ex="false"
fl="65536" doc="2" nid="0" />
+ </method>
+ <method name="Min"
signature="Min(System.Collections.Generic.IEnumerable<System.Nullable<System.Single>>
source) : System.Nullable<System.Single> [static]" excluded="false"
instrumented="true" cc="0" vc="2" nid="0">
+ <seqpnt vc="2" o="1" l="559" el="559" c="13" ec="44" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="2" o="D" l="561" el="561" c="13" ec="88" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="2" o="62" l="562" el="562" c="9" ec="10" ex="false"
fl="65536" doc="2" nid="0" />
+ </method>
+ <method name="Min"
signature="Min<TSource,TResult>(System.Collections.Generic.IEnumerable<TSource>
source,System.Func<TSource,TResult> selector) : TResult [static]"
excluded="false" instrumented="true" cc="0" vc="1" nid="0">
+ <seqpnt vc="1" o="1" l="1342" el="1342" c="13" ec="50" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="1" o="10" l="1343" el="1343" c="9" ec="10" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="Min"
signature="Min<TSource>(System.Collections.Generic.IEnumerable<TSource>
source) : TSource [static]" excluded="false" instrumented="true" cc="0"
vc="2" nid="0">
+ <seqpnt vc="3" o="7" l="1329" el="1329" c="13" ec="54" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="3" o="12" l="1330" el="1330" c="13" ec="76" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="2" o="27" l="1331" el="1331" c="9" ec="10" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="Min"
signature="Min<TSource>(System.Collections.Generic.IEnumerable<TSource>
source,System.Func<TSource,System.Nullable<System.Decimal>>
selector) : System.Nullable<System.Decimal> [static]"
excluded="false" instrumented="true" cc="0" vc="1" nid="0">
+ <seqpnt vc="1" o="1" l="945" el="945" c="13" ec="50" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="1" o="10" l="946" el="946" c="9" ec="10" ex="false"
fl="65536" doc="2" nid="0" />
+ </method>
+ <method name="Min"
signature="Min<TSource>(System.Collections.Generic.IEnumerable<TSource>
source,System.Func<TSource,System.Nullable<System.Double>>
selector) : System.Nullable<System.Double> [static]" excluded="false"
instrumented="true" cc="0" vc="1" nid="0">
+ <seqpnt vc="1" o="1" l="759" el="759" c="13" ec="50" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="1" o="10" l="760" el="760" c="9" ec="10" ex="false"
fl="65536" doc="2" nid="0" />
+ </method>
+ <method name="Min"
signature="Min<TSource>(System.Collections.Generic.IEnumerable<TSource>
source,System.Func<TSource,System.Nullable<System.Int32>>
selector) : System.Nullable<System.Int32> [static]" excluded="false"
instrumented="true" cc="0" vc="1" nid="0">
+ <seqpnt vc="1" o="1" l="201" el="201" c="13" ec="50" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="1" o="10" l="202" el="202" c="9" ec="10" ex="false"
fl="65536" doc="2" nid="0" />
+ </method>
+ <method name="Min"
signature="Min<TSource>(System.Collections.Generic.IEnumerable<TSource>
source,System.Func<TSource,System.Nullable<System.Int64>>
selector) : System.Nullable<System.Int64> [static]" excluded="false"
instrumented="true" cc="0" vc="2" nid="0">
+ <seqpnt vc="2" o="1" l="387" el="387" c="13" ec="50" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="2" o="10" l="388" el="388" c="9" ec="10" ex="false"
fl="65536" doc="2" nid="0" />
+ </method>
+ <method name="Min"
signature="Min<TSource>(System.Collections.Generic.IEnumerable<TSource>
source,System.Func<TSource,System.Nullable<System.Single>>
selector) : System.Nullable<System.Single> [static]" excluded="false"
instrumented="true" cc="0" vc="1" nid="0">
+ <seqpnt vc="1" o="1" l="573" el="573" c="13" ec="50" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="1" o="10" l="574" el="574" c="9" ec="10" ex="false"
fl="65536" doc="2" nid="0" />
+ </method>
+ <method name="MinMaxImpl"
signature="MinMaxImpl<TSource>(System.Collections.Generic.IEnumerable<System.Nullable<TSource>>
source,System.Nullable<TSource>
seed,System.Func<System.Nullable<TSource>,System.Nullable<TSource>,System.Boolean>
lesser) : System.Nullable<TSource> [static]" excluded="false"
instrumented="true" cc="0" vc="24" nid="0">
+ <seqpnt vc="24" o="E" l="1315" el="1315" c="13" ec="44" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="24" o="1A" l="1316" el="1316" c="13" ec="42"
ex="false" fl="65536" doc="3" nid="0" />
+ <seqpnt vc="24" o="2C" l="1318" el="1318" c="13" ec="84"
ex="false" fl="65536" doc="3" nid="0" />
+ <seqpnt vc="24" o="42" l="1320" el="1320" c="9" ec="10" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="MinMaxImpl"
signature="MinMaxImpl<TSource>(System.Collections.Generic.IEnumerable<TSource>
source,System.Func<TSource,TSource,System.Boolean> lesser) : TSource
[static]" excluded="false" instrumented="true" cc="0" vc="4" nid="0">
+ <seqpnt vc="6" o="E" l="1301" el="1301" c="13" ec="44" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="6" o="1A" l="1302" el="1302" c="13" ec="42" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="6" o="2C" l="1304" el="1304" c="13" ec="78" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="4" o="41" l="1305" el="1305" c="9" ec="10" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="OfType"
signature="OfType<TResult>(System.Collections.IEnumerable source) :
System.Collections.Generic.IEnumerable<TResult> [static]"
excluded="false" instrumented="true" cc="0" vc="1" nid="0">
+ <seqpnt vc="1" o="1" l="95" el="95" c="13" ec="44" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="1" o="D" l="97" el="97" c="13" ec="49" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="1" o="16" l="98" el="98" c="9" ec="10" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="OfTypeYield"
signature="OfTypeYield<TResult>(System.Collections.IEnumerable
source) : System.Collections.Generic.IEnumerable<TResult> [static]"
excluded="false" instrumented="false" cc="0" vc="0" nid="0" />
+ <method name="OrderBy"
signature="OrderBy<TSource,TKey>(System.Collections.Generic.IEnumerable<TSource>
source,System.Func<TSource,TKey> keySelector) :
System.Linq.IOrderedEnumerable<TSource> [static]" excluded="false"
instrumented="true" cc="0" vc="5" nid="0">
+ <seqpnt vc="6" o="1" l="1393" el="1393" c="13" ec="69" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="5" o="C" l="1394" el="1394" c="9" ec="10" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="OrderBy"
signature="OrderBy<TSource,TKey>(System.Collections.Generic.IEnumerable<TSource>
source,System.Func<TSource,TKey>
keySelector,System.Collections.Generic.IComparer<TKey> comparer) :
System.Linq.IOrderedEnumerable<TSource> [static]" excluded="false"
instrumented="true" cc="0" vc="6" nid="0">
+ <seqpnt vc="7" o="1" l="1406" el="1406" c="13" ec="44" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="7" o="D" l="1407" el="1407" c="13" ec="54" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="6" o="19" l="1409" el="1409" c="13" ec="112"
ex="false" fl="65536" doc="3" nid="0" />
+ <seqpnt vc="6" o="25" l="1410" el="1410" c="9" ec="10" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="OrderByDescending"
signature="OrderByDescending<TSource,TKey>(System.Collections.Generic.IEnumerable<TSource>
source,System.Func<TSource,TKey> keySelector) :
System.Linq.IOrderedEnumerable<TSource> [static]" excluded="false"
instrumented="true" cc="0" vc="1" nid="0">
+ <seqpnt vc="1" o="1" l="1420" el="1420" c="13" ec="79" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="1" o="C" l="1421" el="1421" c="9" ec="10" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="OrderByDescending"
signature="OrderByDescending<TSource,TKey>(System.Collections.Generic.IEnumerable<TSource>
source,System.Func<TSource,TKey>
keySelector,System.Collections.Generic.IComparer<TKey> comparer) :
System.Linq.IOrderedEnumerable<TSource> [static]" excluded="false"
instrumented="true" cc="0" vc="1" nid="0">
+ <seqpnt vc="1" o="1" l="1433" el="1433" c="13" ec="44" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="1" o="D" l="1434" el="1434" c="13" ec="49" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="1" o="19" l="1436" el="1436" c="13" ec="111"
ex="false" fl="65536" doc="3" nid="0" />
+ <seqpnt vc="1" o="25" l="1437" el="1437" c="9" ec="10" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="Range" signature="Range(System.Int32
start,System.Int32 count) :
System.Collections.Generic.IEnumerable<System.Int32> [static]"
excluded="false" instrumented="true" cc="0" vc="1" nid="0">
+ <seqpnt vc="3" o="1" l="116" el="116" c="13" ec="27" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="1" o="C" l="117" el="117" c="17" ec="77" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="2" o="1E" l="119" el="119" c="13" ec="44" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="2" o="24" l="120" el="120" c="13" ec="41" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="1" o="34" l="121" el="121" c="17" ec="77" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="1" o="46" l="123" el="123" c="13" ec="43" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="1" o="50" l="124" el="124" c="9" ec="10" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="RangeYield" signature="RangeYield(System.Int32
start,System.Int64 end) :
System.Collections.Generic.IEnumerable<System.Int32> [static]"
excluded="false" instrumented="false" cc="0" vc="0" nid="0" />
+ <method name="Renumerable"
signature="Renumerable<T>(System.Collections.Generic.IEnumerator<T>
e) : System.Collections.Generic.IEnumerable<T> [static]"
excluded="false" instrumented="false" cc="0" vc="0" nid="0" />
+ <method name="Repeat" signature="Repeat<TResult>(TResult
element,System.Int32 count) :
System.Collections.Generic.IEnumerable<TResult> [static]"
excluded="false" instrumented="true" cc="0" vc="1" nid="0">
+ <seqpnt vc="2" o="1" l="138" el="138" c="13" ec="27" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="1" o="C" l="138" el="138" c="28" ec="88" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="1" o="1E" l="140" el="140" c="13" ec="48" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="1" o="28" l="141" el="141" c="9" ec="10" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="RepeatYield"
signature="RepeatYield<TResult>(TResult element,System.Int32 count) :
System.Collections.Generic.IEnumerable<TResult> [static]"
excluded="false" instrumented="false" cc="0" vc="0" nid="0" />
+ <method name="Reverse"
signature="Reverse<TSource>(System.Collections.Generic.IEnumerable<TSource>
source) : System.Collections.Generic.IEnumerable<TSource> [static]"
excluded="false" instrumented="true" cc="0" vc="1" nid="0">
+ <seqpnt vc="1" o="1" l="611" el="611" c="13" ec="44" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="1" o="D" l="613" el="613" c="13" ec="41" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="1" o="16" l="614" el="614" c="9" ec="10" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="ReverseYield"
signature="ReverseYield<TSource>(System.Collections.Generic.IEnumerable<TSource>
source) : System.Collections.Generic.IEnumerable<TSource> [static]"
excluded="false" instrumented="false" cc="0" vc="0" nid="0" />
+ <method name="Select"
signature="Select<TSource,TResult>(System.Collections.Generic.IEnumerable<TSource>
source,System.Func<TSource,System.Int32,TResult> selector) :
System.Collections.Generic.IEnumerable<TResult> [static]"
excluded="false" instrumented="true" cc="0" vc="57" nid="0">
+ <seqpnt vc="57" o="1" l="209" el="209" c="13" ec="44" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="57" o="D" l="210" el="210" c="13" ec="48" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="57" o="19" l="212" el="212" c="13" ec="50" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="57" o="23" l="213" el="213" c="9" ec="10" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="Select"
signature="Select<TSource,TResult>(System.Collections.Generic.IEnumerable<TSource>
source,System.Func<TSource,TResult> selector) :
System.Collections.Generic.IEnumerable<TResult> [static]"
excluded="false" instrumented="true" cc="0" vc="50" nid="0">
+ <seqpnt vc="50" o="E" l="195" el="195" c="13" ec="48" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="50" o="1F" l="197" el="197" c="13" ec="63" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="50" o="34" l="198" el="198" c="9" ec="10" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="SelectMany"
signature="SelectMany<TSource,TCollection,TResult>(System.Collections.Generic.IEnumerable<TSource>
source,System.Func<TSource,System.Collections.Generic.IEnumerable<TCollection>>
collectionSelector,System.Func<TSource,TCollection,TResult>
resultSelector) : System.Collections.Generic.IEnumerable<TResult>
[static]" excluded="false" instrumented="true" cc="0" vc="3" nid="0">
+ <seqpnt vc="3" o="E" l="265" el="265" c="13" ec="68" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="3" o="1F" l="267" el="267" c="13" ec="93" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="3" o="35" l="268" el="268" c="9" ec="10" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="SelectMany"
signature="SelectMany<TSource,TCollection,TResult>(System.Collections.Generic.IEnumerable<TSource>
source,System.Func<TSource,System.Int32,System.Collections.Generic.IEnumerable<TCollection>>
collectionSelector,System.Func<TSource,TCollection,TResult>
resultSelector) : System.Collections.Generic.IEnumerable<TResult>
[static]" excluded="false" instrumented="true" cc="0" vc="5" nid="0">
+ <seqpnt vc="5" o="1" l="283" el="283" c="13" ec="44" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="5" o="D" l="284" el="284" c="13" ec="68" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="5" o="19" l="285" el="285" c="13" ec="60" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="5" o="25" l="287" el="287" c="13" ec="80" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="5" o="30" l="288" el="288" c="9" ec="10" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="SelectMany"
signature="SelectMany<TSource,TResult>(System.Collections.Generic.IEnumerable<TSource>
source,System.Func<TSource,System.Collections.Generic.IEnumerable<TResult>>
selector) : System.Collections.Generic.IEnumerable<TResult> [static]"
excluded="false" instrumented="true" cc="0" vc="1" nid="0">
+ <seqpnt vc="1" o="E" l="233" el="233" c="13" ec="48" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="1" o="1F" l="235" el="235" c="13" ec="67" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="1" o="34" l="236" el="236" c="9" ec="10" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="SelectMany"
signature="SelectMany<TSource,TResult>(System.Collections.Generic.IEnumerable<TSource>
source,System.Func<TSource,System.Int32,System.Collections.Generic.IEnumerable<TResult>>
selector) : System.Collections.Generic.IEnumerable<TResult> [static]"
excluded="false" instrumented="true" cc="0" vc="2" nid="0">
+ <seqpnt vc="2" o="1" l="249" el="249" c="13" ec="48" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="2" o="D" l="251" el="251" c="13" ec="76" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="2" o="23" l="252" el="252" c="9" ec="10" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="SelectManyYield"
signature="SelectManyYield<TSource,TCollection,TResult>(System.Collections.Generic.IEnumerable<TSource>
source,System.Func<TSource,System.Int32,System.Collections.Generic.IEnumerable<TCollection>>
collectionSelector,System.Func<TSource,TCollection,TResult>
resultSelector) : System.Collections.Generic.IEnumerable<TResult>
[static]" excluded="false" instrumented="false" cc="0" vc="0" nid="0" />
+ <method name="SelectYield"
signature="SelectYield<TSource,TResult>(System.Collections.Generic.IEnumerable<TSource>
source,System.Func<TSource,System.Int32,TResult> selector) :
System.Collections.Generic.IEnumerable<TResult> [static]"
excluded="false" instrumented="false" cc="0" vc="0" nid="0" />
+ <method name="SequenceEqual"
signature="SequenceEqual<TSource>(System.Collections.Generic.IEnumerable<TSource>
first,System.Collections.Generic.IEnumerable<TSource> second) :
System.Boolean [static]" excluded="false" instrumented="true" cc="0" vc="4"
nid="0">
+ <seqpnt vc="6" o="1" l="1258" el="1258" c="13" ec="69" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="4" o="C" l="1259" el="1259" c="9" ec="10" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="SequenceEqual"
signature="SequenceEqual<TSource>(System.Collections.Generic.IEnumerable<TSource>
first,System.Collections.Generic.IEnumerable<TSource>
second,System.Collections.Generic.IEqualityComparer<TSource>
comparer) : System.Boolean [static]" excluded="false" instrumented="true"
cc="0" vc="1" nid="0">
+ <seqpnt vc="7" o="1" l="1271" el="1271" c="13" ec="42" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="6" o="D" l="1272" el="1272" c="13" ec="44" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="5" o="19" l="1274" el="1274" c="13" ec="70" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="5" o="25" l="1276" el="1276" c="20" ec="69" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="5" o="2C" l="1277" el="1277" c="41" ec="69" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="18" o="35" l="1281" el="1281" c="21" ec="41"
ex="false" fl="65536" doc="3" nid="0" />
+ <seqpnt vc="3" o="3F" l="1282" el="1282" c="25" ec="48" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="15" o="4B" l="1284" el="1284" c="21" ec="41"
ex="false" fl="65536" doc="3" nid="0" />
+ <seqpnt vc="1" o="55" l="1285" el="1285" c="25" ec="38" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="14" o="5A" l="1287" el="1287" c="17" ec="67"
ex="false" fl="65536" doc="3" nid="0" />
+ <seqpnt vc="1" o="97" l="1290" el="1290" c="13" ec="26" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="5" o="9C" l="1291" el="1291" c="9" ec="10" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="Single"
signature="Single<TSource>(System.Collections.Generic.IEnumerable<TSource>
source) : TSource [static]" excluded="false" instrumented="true" cc="0"
vc="2" nid="0">
+ <seqpnt vc="7" o="1" l="514" el="514" c="13" ec="66" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="2" o="F" l="515" el="515" c="9" ec="10" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="Single"
signature="Single<TSource>(System.Collections.Generic.IEnumerable<TSource>
source,System.Func<TSource,System.Boolean> predicate) : TSource
[static]" excluded="false" instrumented="true" cc="0" vc="1" nid="0">
+ <seqpnt vc="5" o="1" l="527" el="527" c="13" ec="52" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="1" o="10" l="528" el="528" c="9" ec="10" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="SingleImpl"
signature="SingleImpl<TSource>(System.Collections.Generic.IEnumerable<TSource>
source,System.Func<TSource> empty) : TSource [static]"
excluded="false" instrumented="true" cc="0" vc="4" nid="0">
+ <seqpnt vc="14" o="1" l="489" el="489" c="13" ec="44" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="14" o="D" l="491" el="491" c="20" ec="50" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="14" o="15" l="493" el="493" c="17" ec="34" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="8" o="23" l="495" el="495" c="21" ec="44" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="8" o="2A" l="496" el="496" c="21" ec="39" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="4" o="34" l="497" el="497" c="25" ec="39" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="4" o="38" l="499" el="499" c="21" ec="59" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="6" o="3E" l="502" el="502" c="17" ec="32" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="7" o="58" l="504" el="504" c="9" ec="10" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="SingleOrDefault"
signature="SingleOrDefault<TSource>(System.Collections.Generic.IEnumerable<TSource>
source) : TSource [static]" excluded="false" instrumented="true" cc="0"
vc="5" nid="0">
+ <seqpnt vc="7" o="1" l="539" el="539" c="13" ec="64" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="5" o="F" l="540" el="540" c="9" ec="10" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="SingleOrDefault"
signature="SingleOrDefault<TSource>(System.Collections.Generic.IEnumerable<TSource>
source,System.Func<TSource,System.Boolean> predicate) : TSource
[static]" excluded="false" instrumented="true" cc="0" vc="3" nid="0">
+ <seqpnt vc="5" o="1" l="553" el="553" c="13" ec="61" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="3" o="10" l="554" el="554" c="9" ec="10" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="Skip"
signature="Skip<TSource>(System.Collections.Generic.IEnumerable<TSource>
source,System.Int32 count) :
System.Collections.Generic.IEnumerable<TSource> [static]"
excluded="false" instrumented="true" cc="0" vc="7" nid="0">
+ <seqpnt vc="7" o="E" l="647" el="647" c="13" ec="58" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="7" o="23" l="648" el="648" c="9" ec="10" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="SkipWhile"
signature="SkipWhile<TSource>(System.Collections.Generic.IEnumerable<TSource>
source,System.Func<TSource,System.Boolean> predicate) :
System.Collections.Generic.IEnumerable<TSource> [static]"
excluded="false" instrumented="true" cc="0" vc="3" nid="0">
+ <seqpnt vc="4" o="E" l="659" el="659" c="13" ec="50" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="3" o="1F" l="661" el="661" c="13" ec="67" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="3" o="34" l="662" el="662" c="9" ec="10" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="SkipWhile"
signature="SkipWhile<TSource>(System.Collections.Generic.IEnumerable<TSource>
source,System.Func<TSource,System.Int32,System.Boolean> predicate) :
System.Collections.Generic.IEnumerable<TSource> [static]"
excluded="false" instrumented="true" cc="0" vc="12" nid="0">
+ <seqpnt vc="12" o="1" l="674" el="674" c="13" ec="44" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="12" o="D" l="675" el="675" c="13" ec="50" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="12" o="19" l="677" el="677" c="13" ec="54" ex="false"
fl="65536" doc="3" nid="0" />
+ <seqpnt vc="12" o="23" l="678" el="678" c="9" ec="10" ex="false"
fl="65536" doc="3" nid="0" />
+ </method>
+ <method name="SkipWhileYield"
signature="SkipWhileYield<TSource>(System.Collections.Generic.IEnumerable<TSource>
source,System.Func<TSource,System.Int32,System.Boolean> predicate) :
System.Collections.Generic.IEnumerable<TSource> [static]"
excluded="false" instrumented="false" cc="0" vc="0" nid="0" />
+ <method name="Sum"
signature="Sum(System.Collections.Generic.IEnumerable<System.Decimal>
source) : System.Decimal [static]" excluded="false" instrumented="true"
cc="0" vc="2" nid="0">
+ <seqpnt vc="2" o="1" l="795" el="795" c="13" ec="44" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="2" o="D" l="797" el="797" c="13" ec="29" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="2" o="15" l="798" el="798" c="33" ec="39" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="6" o="1E" l="798" el="798" c="22" ec="29" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="6" o="25" l="799" el="799" c="17" ec="42" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="8" o="2D" l="798" el="798" c="30" ec="32" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="2" o="4E" l="801" el="801" c="13" ec="24" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="2" o="52" l="802" el="802" c="9" ec="10" ex="false"
fl="65536" doc="2" nid="0" />
+ </method>
+ <method name="Sum"
signature="Sum(System.Collections.Generic.IEnumerable<System.Double>
source) : System.Double [static]" excluded="false" instrumented="true"
cc="0" vc="2" nid="0">
+ <seqpnt vc="2" o="1" l="609" el="609" c="13" ec="44" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="2" o="D" l="611" el="611" c="13" ec="28" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="2" o="18" l="612" el="612" c="33" ec="39" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="6" o="21" l="612" el="612" c="22" ec="29" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="6" o="29" l="613" el="613" c="17" ec="42" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="8" o="2D" l="612" el="612" c="30" ec="32" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="2" o="4E" l="615" el="615" c="13" ec="24" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="2" o="52" l="616" el="616" c="9" ec="10" ex="false"
fl="65536" doc="2" nid="0" />
+ </method>
+ <method name="Sum"
signature="Sum(System.Collections.Generic.IEnumerable<System.Int32>
source) : System.Int32 [static]" excluded="false" instrumented="true"
cc="0" vc="2" nid="0">
+ <seqpnt vc="3" o="1" l="51" el="51" c="13" ec="44" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="3" o="D" l="53" el="53" c="13" ec="25" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="3" o="10" l="54" el="54" c="33" ec="39" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="15" o="19" l="54" el="54" c="22" ec="29" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="15" o="20" l="55" el="55" c="17" ec="42" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="17" o="24" l="54" el="54" c="30" ec="32" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="2" o="45" l="57" el="57" c="13" ec="24" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="2" o="49" l="58" el="58" c="9" ec="10" ex="false"
fl="65536" doc="2" nid="0" />
+ </method>
+ <method name="Sum"
signature="Sum(System.Collections.Generic.IEnumerable<System.Int64>
source) : System.Int64 [static]" excluded="false" instrumented="true"
cc="0" vc="2" nid="0">
+ <seqpnt vc="2" o="1" l="237" el="237" c="13" ec="44" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="2" o="D" l="239" el="239" c="13" ec="26" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="2" o="11" l="240" el="240" c="33" ec="39" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="6" o="1A" l="240" el="240" c="22" ec="29" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="6" o="21" l="241" el="241" c="17" ec="42" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="8" o="25" l="240" el="240" c="30" ec="32" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="2" o="46" l="243" el="243" c="13" ec="24" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="2" o="4A" l="244" el="244" c="9" ec="10" ex="false"
fl="65536" doc="2" nid="0" />
+ </method>
+ <method name="Sum"
signature="Sum(System.Collections.Generic.IEnumerable<System.Nullable<System.Decimal>>
source) : System.Nullable<System.Decimal> [static]" excluded="false"
instrumented="true" cc="0" vc="2" nid="0">
+ <seqpnt vc="2" o="1" l="863" el="863" c="13" ec="44" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="2" o="D" l="865" el="865" c="13" ec="29" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="2" o="15" l="866" el="866" c="33" ec="39" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="9" o="1E" l="866" el="866" c="22" ec="29" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="9" o="25" l="867" el="867" c="17" ec="49" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="11" o="47" l="866" el="866" c="30" ec="32" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="2" o="68" l="869" el="869" c="13" ec="24" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="2" o="71" l="870" el="870" c="9" ec="10" ex="false"
fl="65536" doc="2" nid="0" />
+ </method>
+ <method name="Sum"
signature="Sum(System.Collections.Generic.IEnumerable<System.Nullable<System.Double>>
source) : System.Nullable<System.Double> [static]" excluded="false"
instrumented="true" cc="0" vc="2" nid="0">
+ <seqpnt vc="2" o="1" l="677" el="677" c="13" ec="44" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="2" o="D" l="679" el="679" c="13" ec="28" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="2" o="18" l="680" el="680" c="33" ec="39" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="9" o="21" l="680" el="680" c="22" ec="29" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="9" o="28" l="681" el="681" c="17" ec="49" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="11" o="4B" l="680" el="680" c="30" ec="32" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="2" o="6C" l="683" el="683" c="13" ec="24" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="2" o="75" l="684" el="684" c="9" ec="10" ex="false"
fl="65536" doc="2" nid="0" />
+ </method>
+ <method name="Sum"
signature="Sum(System.Collections.Generic.IEnumerable<System.Nullable<System.Int32>>
source) : System.Nullable<System.Int32> [static]" excluded="false"
instrumented="true" cc="0" vc="2" nid="0">
+ <seqpnt vc="2" o="1" l="119" el="119" c="13" ec="44" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="2" o="D" l="121" el="121" c="13" ec="25" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="2" o="10" l="122" el="122" c="33" ec="39" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="8" o="19" l="122" el="122" c="22" ec="29" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="8" o="20" l="123" el="123" c="17" ec="49" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="10" o="39" l="122" el="122" c="30" ec="32" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="2" o="5A" l="125" el="125" c="13" ec="24" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="2" o="63" l="126" el="126" c="9" ec="10" ex="false"
fl="65536" doc="2" nid="0" />
+ </method>
+ <method name="Sum"
signature="Sum(System.Collections.Generic.IEnumerable<System.Nullable<System.Int64>>
source) : System.Nullable<System.Int64> [static]" excluded="false"
instrumented="true" cc="0" vc="2" nid="0">
+ <seqpnt vc="2" o="1" l="305" el="305" c="13" ec="44" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="2" o="D" l="307" el="307" c="13" ec="26" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="2" o="11" l="308" el="308" c="33" ec="39" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="9" o="1A" l="308" el="308" c="22" ec="29" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="9" o="21" l="309" el="309" c="17" ec="49" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="11" o="3B" l="308" el="308" c="30" ec="32" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="2" o="5C" l="311" el="311" c="13" ec="24" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="2" o="65" l="312" el="312" c="9" ec="10" ex="false"
fl="65536" doc="2" nid="0" />
+ </method>
+ <method name="Sum"
signature="Sum(System.Collections.Generic.IEnumerable<System.Nullable<System.Single>>
source) : System.Nullable<System.Single> [static]" excluded="false"
instrumented="true" cc="0" vc="2" nid="0">
+ <seqpnt vc="2" o="1" l="491" el="491" c="13" ec="44" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="2" o="D" l="493" el="493" c="13" ec="27" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="2" o="14" l="494" el="494" c="33" ec="39" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="9" o="1D" l="494" el="494" c="22" ec="29" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="9" o="24" l="495" el="495" c="17" ec="49" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="11" o="43" l="494" el="494" c="30" ec="32" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="2" o="64" l="497" el="497" c="13" ec="24" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="2" o="6D" l="498" el="498" c="9" ec="10" ex="false"
fl="65536" doc="2" nid="0" />
+ </method>
+ <method name="Sum"
signature="Sum(System.Collections.Generic.IEnumerable<System.Single>
source) : System.Single [static]" excluded="false" instrumented="true"
cc="0" vc="2" nid="0">
+ <seqpnt vc="2" o="1" l="423" el="423" c="13" ec="44" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="2" o="D" l="425" el="425" c="13" ec="27" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="2" o="14" l="426" el="426" c="33" ec="39" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="6" o="1D" l="426" el="426" c="22" ec="29" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="6" o="25" l="427" el="427" c="17" ec="42" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="8" o="29" l="426" el="426" c="30" ec="32" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="2" o="4A" l="429" el="429" c="13" ec="24" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="2" o="4E" l="430" el="430" c="9" ec="10" ex="false"
fl="65536" doc="2" nid="0" />
+ </method>
+ <method name="Sum"
signature="Sum<TSource>(System.Collections.Generic.IEnumerable<TSource>
source,System.Func<TSource,System.Decimal> selector) : System.Decimal
[static]" excluded="false" instrumented="true" cc="0" vc="1" nid="0">
+ <seqpnt vc="1" o="1" l="814" el="814" c="13" ec="50" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="1" o="10" l="815" el="815" c="9" ec="10" ex="false"
fl="65536" doc="2" nid="0" />
+ </method>
+ <method name="Sum"
signature="Sum<TSource>(System.Collections.Generic.IEnumerable<TSource>
source,System.Func<TSource,System.Double> selector) : System.Double
[static]" excluded="false" instrumented="true" cc="0" vc="1" nid="0">
+ <seqpnt vc="1" o="1" l="628" el="628" c="13" ec="50" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="1" o="10" l="629" el="629" c="9" ec="10" ex="false"
fl="65536" doc="2" nid="0" />
+ </method>
+ <method name="Sum"
signature="Sum<TSource>(System.Collections.Generic.IEnumerable<TSource>
source,System.Func<TSource,System.Int32> selector) : System.Int32
[static]" excluded="false" instrumented="true" cc="0" vc="1" nid="0">
+ <seqpnt vc="1" o="1" l="70" el="70" c="13" ec="50" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="1" o="10" l="71" el="71" c="9" ec="10" ex="false"
fl="65536" doc="2" nid="0" />
+ </method>
+ <method name="Sum"
signature="Sum<TSource>(System.Collections.Generic.IEnumerable<TSource>
source,System.Func<TSource,System.Int64> selector) : System.Int64
[static]" excluded="false" instrumented="true" cc="0" vc="1" nid="0">
+ <seqpnt vc="1" o="1" l="256" el="256" c="13" ec="50" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="1" o="10" l="257" el="257" c="9" ec="10" ex="false"
fl="65536" doc="2" nid="0" />
+ </method>
+ <method name="Sum"
signature="Sum<TSource>(System.Collections.Generic.IEnumerable<TSource>
source,System.Func<TSource,System.Nullable<System.Decimal>>
selector) : System.Nullable<System.Decimal> [static]"
excluded="false" instrumented="true" cc="0" vc="1" nid="0">
+ <seqpnt vc="1" o="1" l="882" el="882" c="13" ec="50" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="1" o="10" l="883" el="883" c="9" ec="10" ex="false"
fl="65536" doc="2" nid="0" />
+ </method>
+ <method name="Sum"
signature="Sum<TSource>(System.Collections.Generic.IEnumerable<TSource>
source,System.Func<TSource,System.Nullable<System.Double>>
selector) : System.Nullable<System.Double> [static]" excluded="false"
instrumented="true" cc="0" vc="1" nid="0">
+ <seqpnt vc="1" o="1" l="696" el="696" c="13" ec="50" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="1" o="10" l="697" el="697" c="9" ec="10" ex="false"
fl="65536" doc="2" nid="0" />
+ </method>
+ <method name="Sum"
signature="Sum<TSource>(System.Collections.Generic.IEnumerable<TSource>
source,System.Func<TSource,System.Nullable<System.Int32>>
selector) : System.Nullable<System.Int32> [static]" excluded="false"
instrumented="true" cc="0" vc="1" nid="0">
+ <seqpnt vc="1" o="1" l="138" el="138" c="13" ec="50" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="1" o="10" l="139" el="139" c="9" ec="10" ex="false"
fl="65536" doc="2" nid="0" />
+ </method>
+ <method name="Sum"
signature="Sum<TSource>(System.Collections.Generic.IEnumerable<TSource>
source,System.Func<TSource,System.Nullable<System.Int64>>
selector) : System.Nullable<System.Int64> [static]" excluded="false"
instrumented="true" cc="0" vc="1" nid="0">
+ <seqpnt vc="1" o="1" l="324" el="324" c="13" ec="50" ex="false"
fl="65536" doc="2" nid="0" />
+ <seqpnt vc="1" o="10" l="325" el="325" c="9" ec="10" ex="false"
fl="65536" doc="2" nid="0" />
***The diff for this file has been truncated for email.***
=======================================
--- /dev/null
+++ /test/TestResultsWiki/CamelCase.cs Sat Apr 30 05:48:09 2011
@@ -0,0 +1,85 @@
+#region License, Terms and Author(s)
+//
+// LINQBridge
+// Copyright (c) 2007-9 Atif Aziz, Joseph Albahari. All rights reserved.
+//
+// Author(s):
+//
+// Dominik Hug,
http://www.dominikhug.ch
+//
+// This library is free software; you can redistribute it and/or modify it
+// under the terms of the New BSD License, a copy of which should have
+// been delivered along with this distribution.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+#endregion
+
+namespace TestResultsWiki
+{
+ #region Imports
+
+ using System.Collections.Generic;
+ using System.Linq;
+ using System.Text;
+
+ #endregion
+
+ internal static class CamelCase
+ {
+ /// <summary>
+ /// Parses and yields words from a string of camel-cased words.
+ /// For example, <c>"HelloWorld"</c> is parse
+ /// into the sequence { <c>"Hello"</c>, <c>"World"</c> }.
+ /// </summary>
+
+ public static IEnumerable<string> GetWords(string camelCase)
+ {
+ if (string.IsNullOrEmpty(camelCase))
+ yield break;
+
+ var sb = new StringBuilder();
+
+ for (var i = 0; i < camelCase.Length; i++)
+ {
+ var ch = camelCase[i];
+ if (char.IsUpper(ch) && sb.Length > 0)
+ {
+ yield return sb.ToString();
+ sb.Length = 0;
+ }
+ sb.Append(ch);
+ }
+
+ if (sb.Length > 0)
+ yield return sb.ToString();
+ }
+
+ /// <summary>
+ /// Creates a sentence out of a camel-cased string of words.
+ /// For example, <c>"TheQuickBrownFox"</c> is converted to
+ /// <c>"The quick brown fox"</c>.
+ /// </summary>
+
+ public static string FormatSentence(string camelCase)
+ {
+ if (string.IsNullOrEmpty(camelCase))
+ return string.Empty;
+
+ var words = GetWords(camelCase)
+ .Select((word, i) => i > 0 ? word.DecapWord() :
word);
+
+ return string.Join(" ", words.ToArray());
+ }
+ }
+}
=======================================
--- /dev/null
+++ /test/TestResultsWiki/Program.cs Sat Apr 30 05:48:09 2011
@@ -0,0 +1,170 @@
+#region License, Terms and Author(s)
+//
+// LINQBridge
+// Copyright (c) 2007-9 Atif Aziz, Joseph Albahari. All rights reserved.
+//
+// Author(s):
+//
+// Dominik Hug,
http://www.dominikhug.ch
+//
+// This library is free software; you can redistribute it and/or modify it
+// under the terms of the New BSD License, a copy of which should have
+// been delivered along with this distribution.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+#endregion
+
+namespace TestResultsWiki
+{
+ #region Imports
+
+ using System;
+ using System.Diagnostics;
+ using System.IO;
+ using System.Linq;
+ using System.Xml;
+
+ #endregion
+
+ internal static class Program
+ {
+ private static int Main(string[] args)
+ {
+ try
+ {
+ Run(args);
+ return 0;
+ }
+ catch (Exception e)
+ {
+ Console.Error.WriteLine(e.Message);
+ Trace.TraceError(e.ToString());
+ return -1;
+ }
+ }
+
+ private static void Run(string[] args)
+ {
+ if (args.Length == 0)
+ throw new ApplicationException("Missing NUnit XML output
file name argument.");
+
+ const string testCaseXPath
= "//test-suite[@name='EnumerableFixture']/results/test-case";
+
+ var reports = (
+ from arg in args
+ let parts = arg.Split(new[]{'='}, 2)
+ let path = parts.Last()
+ select new {
+ Title = parts.Length > 1
&& !string.IsNullOrEmpty(parts[0])
+ ? parts[0]
+ : Path.GetFileNameWithoutExtension(path),
+ TestCases =
LoadXmlDocument(path).SelectNodes(testCaseXPath).Cast<XmlElement>().ToArray()
+ }
+ ).ToArray();
+
+ var baseHeaders = new[]
+ {
+ "Method under test",
+ "Test condition",
+ "Expected result"
+ };
+
+ var headers = reports.Select(r => "*" + r.Title
+ "*").Concat(baseHeaders).ToArray();
+ var testByName = reports.SelectMany(r => r.TestCases)
+ .GroupBy(test =>
test.GetAttribute("name").Split('.').Last())
+ .ToArray();
+
+ if (reports.Length > 1)
+ {
+ var inconsistencies = testByName.Where(g => g.Count() !=
reports.Length).ToArray();
+ if (inconsistencies.Length > 0)
+ {
+ foreach (var test in inconsistencies)
+ Console.Error.WriteLine("Missing results for
{0}.", test.Key);
+ throw new ApplicationException("Tests results are
inconsistent.");
+ }
+ }
+
+ const string msdnUrlFormat =
@"
http://msdn.microsoft.com/en-us/library/system.linq.enumerable.{0}.aspx";
+
+ var suite = from nodes in testByName
+ where nodes.Key.Contains("_")
+ let description = new TestCaseName(nodes.Key)
+ let results = (
+ from node in nodes
+ let success
= "true".Equals(node.GetAttribute("success"),
StringComparison.OrdinalIgnoreCase)
+ select new
+ {
+ Success = success,
+ Executed
= "true".Equals(node.GetAttribute("executed"),
StringComparison.OrdinalIgnoreCase),
+ Message = success ? null :
node.SelectSingleNode("*/message").InnerText
+ })
+ .ToArray()
+ select new { Description = description, Results =
results };
+
+ //
+ // Create the table of results, which is an array (rows) of
+ // string array (columns).
+ //
+
+ var table = //...
+ Enumerable.Repeat(headers, 1) // prepend headers to rows...
+ .Concat(
+ from test in suite
+ let info = test.Description
+ select (
+ test.Results
+ .Select(r => r.Executed ?
(r.Success ? "PASS" : "*FAIL*") : "-")
+ .Concat(new[] {
+ string.Format(@"[{0} {1}]{2}",
+ /* 0 */ string.Format(msdnUrlFormat,
info.MethodName.ToLowerInvariant()),
+ /* 1 */ info.MethodName,
+ /* 2 */ info.Arguments.Any()
+ ? "(" + string.Join(", ",
info.Arguments.ToArray()) + ")"
+ : string.Empty),
+ info.StateUnderTest,
+ info.ExpectedBehavior
+ }))
+ .ToArray()
+ ).ToArray();
+
+ //
+ // Calculate the fixed width for each column based on maximum
+ // width across corresponding cells.
+ //
+
+ var widths = headers.Select((h, i) => table.Max(cols =>
cols[i].Length))
+ .ToArray();
+
+ //
+ // Write out the table in Wiki format where each cell is padded
+ // to the columns width.
+ //
+
+ foreach (var row in table)
+ {
+ Console.WriteLine("|| {0} ||",
+ string.Join(" || ",
+ row.Select((col, i) =>
col.PadRight(widths[i])).ToArray()));
+ }
+ }
+
+ private static XmlDocument LoadXmlDocument(string path)
+ {
+ var document = new XmlDocument();
+ document.Load(path);
+ return document;
+ }
+ }
+}
=======================================
--- /dev/null
+++ /test/TestResultsWiki/StringHelper.cs Sat Apr 30 05:48:09 2011
@@ -0,0 +1,48 @@
+#region License, Terms and Author(s)
+//
+// LINQBridge
+// Copyright (c) 2007-9 Atif Aziz, Joseph Albahari. All rights reserved.
+//
+// Author(s):
+//
+// Dominik Hug,
http://www.dominikhug.ch
+//
+// This library is free software; you can redistribute it and/or modify it
+// under the terms of the New BSD License, a copy of which should have
+// been delivered along with this distribution.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+#endregion
+
+namespace TestResultsWiki
+{
+ using System;
+
+ internal static class StringHelper
+ {
+ /// <summary>
+ /// De-capitalizes by changing the first letter of the given word
to
+ /// lower case.
+ /// </summary>
+
+ public static string DecapWord(this string word)
+ {
+ return string.IsNullOrEmpty(word)
+ ? string.Empty
+ : char.IsUpper(word, 0)
+ ? Char.ToLower(word[0]) + word.Substring(1)
+ : word;
+ }
+ }
+}
=======================================
--- /dev/null
+++ /test/TestResultsWiki/TestCaseName.cs Sat Apr 30 05:48:09 2011
@@ -0,0 +1,92 @@
+#region License, Terms and Author(s)
+//
+// LINQBridge
+// Copyright (c) 2007-9 Atif Aziz, Joseph Albahari. All rights reserved.
+//
+// Author(s):
+//
+// Dominik Hug,
http://www.dominikhug.ch
+//
+// This library is free software; you can redistribute it and/or modify it
+// under the terms of the New BSD License, a copy of which should have
+// been delivered along with this distribution.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+#endregion
+
+namespace TestResultsWiki
+{
+ #region Imports
+
+ using System;
+ using System.Collections.Generic;
+ using System.Collections.ObjectModel;
+ using System.Linq;
+
+ #endregion
+
+ /// <summary>
+ /// Helps to extract method name, parameters, test condition and
expectation.
+ /// </summary>
+
+ [ Serializable ]
+ internal sealed class TestCaseName
+ {
+ private static readonly IList<string> zeroArguments = new
string[0];
+
+ /// <param name="name">
+ /// String like
<c>"Distinct_ComparerArg_NonDistinctValues_ReturnsOnlyDistinctValues"</c>.</param>
+
+ public TestCaseName(string name)
+ {
+ var parts = new Queue<string>(name.Split(new[] {'_'}, 4,
StringSplitOptions.RemoveEmptyEntries));
+
+ if (parts.Count < 2)
+ throw new ArgumentException(null, "name");
+
+ MethodName = parts.Dequeue();
+
+ Arguments = parts.Count < 3
+ ? zeroArguments
+ : new ReadOnlyCollection<string>(
+ parts.Dequeue()
+ .Split(new[] {"Arg"},
StringSplitOptions.RemoveEmptyEntries)
+ .TakeWhile(s => s.Length > 0)
+ .ToArray());
+
+ StateUnderTest = parts.Count > 1
+ ? CamelCase.FormatSentence(parts.Dequeue())
+ : string.Empty;
+
+ ExpectedBehavior = parts.Dequeue();
+
+ var throwsWord = "Throws";
+ if (ExpectedBehavior.StartsWith(throwsWord,
StringComparison.InvariantCultureIgnoreCase)
+ && ExpectedBehavior.EndsWith("Exception",
StringComparison.InvariantCultureIgnoreCase))
+ {
+ ExpectedBehavior = ExpectedBehavior.Substring(0,
throwsWord.Length)
+ + " " +
ExpectedBehavior.Substring(throwsWord.Length);
+ }
+ else
+ {
+ ExpectedBehavior =
CamelCase.FormatSentence(ExpectedBehavior);
+ }
+ }
+
+ public string MethodName { get; private set; }
+ public IList<string> Arguments { get; private set; }
+ public string StateUnderTest { get; private set; }
+ public string ExpectedBehavior { get; private set; }
+ }
+}
=======================================
--- /dev/null
+++ /test/TestResultsWiki/TestResultsWiki.csproj Sat Apr 30 05:48:09 2011
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="3.5" DefaultTargets="Build"
xmlns="
http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)'
== '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>9.0.30729</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{13CDFE15-3BA8-4FA5-B21E-832E56525541}</ProjectGuid>
+ <OutputType>Exe</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>TestResultsWiki</RootNamespace>
+ <AssemblyName>TestResultsWiki</AssemblyName>
+ <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+ <FileAlignment>512</FileAlignment>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|
AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|
AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="System" />
+ <Reference Include="System.Core">
+ <RequiredTargetFramework>3.5</RequiredTargetFramework>
+ </Reference>
+ <Reference Include="System.Data" />
+ <Reference Include="System.Xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="CamelCase.cs" />
+ <Compile Include="Program.cs" />
+ <Compile Include="StringHelper.cs" />
+ <Compile Include="TestCaseName.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <Folder Include="Properties\" />
+ </ItemGroup>
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the
targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+</Project>
==============================================================================
Revision: 1c7ea47af913
Author: azizatif
Date: Sat Apr 30 05:48:20 2011
Log: Added tag v1.2 for changeset 96c90603bdff
http://code.google.com/p/linqbridge/source/detail?r=1c7ea47af913
Added:
/.hgtags
=======================================
--- /dev/null
+++ /.hgtags Sat Apr 30 05:48:20 2011
@@ -0,0 +1,1 @@
+96c90603bdffc2051bb24859f97e75d25e10727d v1.2
==============================================================================
Revision: 6793c8802f84
Author: azizatif
Date: Sat Apr 30 05:50:05 2011
Log: Fixed issue #17: Distinct missing coverage for multiple nulls
case (imported from svn r243)
http://code.google.com/p/linqbridge/source/detail?r=6793c8802f84
Modified:
/test/LINQBridge.Tests/EnumerableFixture.cs
=======================================
--- /test/LINQBridge.Tests/EnumerableFixture.cs Sat Apr 30 05:48:09 2011
+++ /test/LINQBridge.Tests/EnumerableFixture.cs Sat Apr 30 05:50:05 2011
@@ -513,6 +513,15 @@
Assert.That(set.Current, Is.Null);
Assert.That(set.MoveNext(), Is.False);
}
+
+ [Test(Description = "See
http://code.google.com/p/linqbridge/issues/detail?id=17")]
+ public void Distinct_StringArrayWithSeveralNull_YieldsSet()
+ {
+ var set = new List<string> { null, null, null
}.Distinct().GetEnumerator();
+ Assert.That(set.MoveNext(), Is.True);
+ Assert.That(set.Current, Is.Null);
+ Assert.That(set.MoveNext(), Is.False);
+ }
[Test]
[ExpectedException(typeof(ArgumentOutOfRangeException))]
==============================================================================
Revision: 68aedec033f8
Author: azizatif
Date: Sat Apr 30 05:52:39 2011
Log: Fixed issue #15: Method Take iterates over all elements (imported
from svn r248)
http://code.google.com/p/linqbridge/source/detail?r=68aedec033f8
Modified:
/src/Enumerable.cs
/src/Properties/AssemblyInfo.cs
=======================================
--- /src/Enumerable.cs Sat Apr 30 05:48:09 2011
+++ /src/Enumerable.cs Sat Apr 30 05:52:39 2011
@@ -25,7 +25,7 @@
//
#endregion
-// $Id: Enumerable.cs 240 2010-10-19 21:49:03Z azizatif $
+// $Id: Enumerable.cs 248 2011-01-17 06:52:23Z azizatif $
namespace System.Linq
{
@@ -632,7 +632,7 @@
this IEnumerable<TSource> source,
int count)
{
- return source.Where((item, i) => i < count);
+ return source.TakeWhile((item, i) => i < count);
}
/// <summary>
=======================================
--- /src/Properties/AssemblyInfo.cs Sat Apr 30 05:48:09 2011
+++ /src/Properties/AssemblyInfo.cs Sat Apr 30 05:52:39 2011
@@ -51,4 +51,4 @@
[assembly: Guid("1d8ca19d-f7ef-47f2-8144-4099aab2b2b7")]
[assembly: AssemblyVersion("1.2.0.0")]
-[assembly: AssemblyFileVersion("1.2.13016.2208")]
+[assembly: AssemblyFileVersion("1.2.13216.2214")]
==============================================================================
Revision: 10d8fe3bc413
Author: azizatif
Date: Sat Apr 30 05:55:44 2011
Log: Implemented Skip in terms of SkipWhile, for sake of consistency
with Take[1] and as suggested in comment #3[1] to issue #15 (imported from
svn r249) [1]
http://code.google.com/p/linqbridge/issues/detail?id=15#c3
http://code.google.com/p/linqbridge/source/detail?r=10d8fe3bc413
Modified:
/src/Enumerable.cs
=======================================
--- /src/Enumerable.cs Sat Apr 30 05:52:39 2011
+++ /src/Enumerable.cs Sat Apr 30 05:55:44 2011
@@ -25,7 +25,7 @@
//
#endregion
-// $Id: Enumerable.cs 248 2011-01-17 06:52:23Z azizatif $
+// $Id: Enumerable.cs 249 2011-01-17 07:00:59Z azizatif $
namespace System.Linq
{
@@ -337,6 +337,18 @@
else
break;
}
+
+ /// <summary>
+ /// Returns a specified number of contiguous elements from the
start
+ /// of a sequence.
+ /// </summary>
+
+ public static IEnumerable<TSource> Take<TSource>(
+ this IEnumerable<TSource> source,
+ int count)
+ {
+ return source.TakeWhile((item, i) => i < count);
+ }
private static class Futures<T>
{
@@ -622,30 +634,6 @@
foreach (var item in stack)
yield return item;
}
-
- /// <summary>
- /// Returns a specified number of contiguous elements from the
start
- /// of a sequence.
- /// </summary>
-
- public static IEnumerable<TSource> Take<TSource>(
- this IEnumerable<TSource> source,
- int count)
- {
- return source.TakeWhile((item, i) => i < count);
- }
-
- /// <summary>
- /// Bypasses a specified number of elements in a sequence and then
- /// returns the remaining elements.
- /// </summary>
-
- public static IEnumerable<TSource> Skip<TSource>(
- this IEnumerable<TSource> source,
- int count)
- {
- return source.Where((item, i) => i >= count);
- }
/// <summary>
/// Bypasses elements in a sequence as long as a specified
condition
@@ -695,6 +683,18 @@
do { yield return e.Current; } while (e.MoveNext());
}
}
+
+ /// <summary>
+ /// Bypasses a specified number of elements in a sequence and then
+ /// returns the remaining elements.
+ /// </summary>
+
+ public static IEnumerable<TSource> Skip<TSource>(
+ this IEnumerable<TSource> source,
+ int count)
+ {
+ return source.SkipWhile((item, i) => i < count);
+ }
/// <summary>
/// Returns the number of elements in a sequence.
==============================================================================
Revision: 153ecaa4778f
Author: azizatif
Date: Sat Apr 30 05:58:51 2011
Log: Addressed warning CS0436: ExtensionAttribute in
src\ExtensionAttribute.cs conflicts with the imported type
ExtensionAttribute in LinqBridge.dll (imported from svn r250)
http://code.google.com/p/linqbridge/source/detail?r=153ecaa4778f
Modified:
/test/LINQBridge.Tests/LINQBridge.Tests.csproj
=======================================
--- /test/LINQBridge.Tests/LINQBridge.Tests.csproj Sat Apr 30 05:48:09 2011
+++ /test/LINQBridge.Tests/LINQBridge.Tests.csproj Sat Apr 30 05:58:51 2011
@@ -33,9 +33,6 @@
<Reference Include="System" />
</ItemGroup>
<ItemGroup>
- <Compile Include="..\..\src\ExtensionAttribute.cs">
- <Link>ExtensionAttribute.cs</Link>
- </Compile>
<Compile Include="EnumerableFixture.cs" />
<Compile Include="Reader.cs" />
<Compile Include="Tester.cs" />
==============================================================================
Revision: b89b0c17fdaa
Author: azizatif
Date: Sat Apr 30 06:00:17 2011
Log: Fixed issue #18: AsEnumerable is not an extension method
(imported from svn r251)
http://code.google.com/p/linqbridge/source/detail?r=b89b0c17fdaa
Modified:
/src/Enumerable.cs
/test/LINQBridge.Tests/EnumerableFixture.cs
=======================================
--- /src/Enumerable.cs Sat Apr 30 05:55:44 2011
+++ /src/Enumerable.cs Sat Apr 30 06:00:17 2011
@@ -25,7 +25,7 @@
//
#endregion
-// $Id: Enumerable.cs 249 2011-01-17 07:00:59Z azizatif $
+// $Id: Enumerable.cs 251 2011-01-17 07:34:22Z azizatif $
namespace System.Linq
{
@@ -50,7 +50,7 @@
/// Returns the input typed as <see cref="IEnumerable{T}"/>.
/// </summary>
- public static IEnumerable<TSource>
AsEnumerable<TSource>(IEnumerable<TSource> source)
+ public static IEnumerable<TSource> AsEnumerable<TSource>(this
IEnumerable<TSource> source)
{
return source;
}
=======================================
--- /test/LINQBridge.Tests/EnumerableFixture.cs Sat Apr 30 05:50:05 2011
+++ /test/LINQBridge.Tests/EnumerableFixture.cs Sat Apr 30 06:00:17 2011
@@ -34,11 +34,12 @@
using System.Collections;
using System.Collections.Generic;
using System.Globalization;
- using System.Text;
+ using System.Reflection;
using NUnit.Framework;
using System.Linq;
using NUnit.Framework.SyntaxHelpers;
using System.Diagnostics;
+ using ExtensionAttribute =
System.Runtime.CompilerServices.ExtensionAttribute;
#endregion
@@ -2195,6 +2196,26 @@
{
Assert.That(Enumerable.AsEnumerable<object>(null), Is.Null);
}
+
+ [Test]
+ public void Operators_AsExtensionMethods()
+ {
+ var extensionType = typeof(ExtensionAttribute);
+ var ops = typeof(Enumerable).GetMethods(BindingFlags.Static |
BindingFlags.Public);
+ foreach (var op in ops)
+ {
+ var parameters = op.GetParameters();
+ var extendedType = parameters.Length > 0 ?
parameters[0].ParameterType : null;
+
+ if ( extendedType != null
+ && extendedType.IsGenericType
+ && extendedType.GetGenericTypeDefinition() == typeof
(IEnumerable<>))
+ {
+ var result = Attribute.IsDefined(op, extensionType);
+ Assert.That(result, Is.True, "{0} is not defined as an
extension method.", op);
+ }
+ }
+ }
private Reader<T> Read<T>(params T[] source)
{
==============================================================================
Revision: 4c97455fb125
Author: azizatif
Date: Sat Apr 30 06:01:11 2011
Log: Updated Operators_AsExtensionMethods test to include also
operators that extend IOrderedEnumerable<T>, like ThenBy (imported from svn
r252)
http://code.google.com/p/linqbridge/source/detail?r=4c97455fb125
Modified:
/test/LINQBridge.Tests/EnumerableFixture.cs
=======================================
--- /test/LINQBridge.Tests/EnumerableFixture.cs Sat Apr 30 06:00:17 2011
+++ /test/LINQBridge.Tests/EnumerableFixture.cs Sat Apr 30 06:01:11 2011
@@ -2201,21 +2201,25 @@
public void Operators_AsExtensionMethods()
{
var extensionType = typeof(ExtensionAttribute);
- var ops = typeof(Enumerable).GetMethods(BindingFlags.Static |
BindingFlags.Public);
- foreach (var op in ops)
- {
- var parameters = op.GetParameters();
- var extendedType = parameters.Length > 0 ?
parameters[0].ParameterType : null;
-
- if ( extendedType != null
- && extendedType.IsGenericType
- && extendedType.GetGenericTypeDefinition() == typeof
(IEnumerable<>))
- {
- var result = Attribute.IsDefined(op, extensionType);
- Assert.That(result, Is.True, "{0} is not defined as an
extension method.", op);
- }
+ var ops = typeof(Enumerable).GetMethods(BindingFlags.Static |
BindingFlags.Public);
+ foreach (var op in Array.FindAll(ops, MethodExtendsSequence))
+ {
+ var result = Attribute.IsDefined(op, extensionType);
+ Assert.That(result, Is.True, "{0} is not defined as an
extension method.", op);
}
}
+
+ private static bool MethodExtendsSequence(MethodInfo op)
+ {
+ var parameters = op.GetParameters();
+ var extendedType = parameters.Length > 0 ?
parameters[0].ParameterType : null;
+
+ return extendedType != null
+ && (extendedType == typeof(IEnumerable)
+ || (extendedType.IsGenericType
+ && ( extendedType.GetGenericTypeDefinition() ==
typeof(IEnumerable<>)
+ || extendedType.GetGenericTypeDefinition() ==
typeof(IOrderedEnumerable<>))));
+ }
private Reader<T> Read<T>(params T[] source)
{
==============================================================================
Revision: 0f434ffce108
Author: azizatif
Date: Sat Apr 30 06:02:19 2011
Log: Fixed issue #19: Min behaves differently (imported from svn r253)
http://code.google.com/p/linqbridge/source/detail?r=0f434ffce108
Modified:
/src/Enumerable.cs
/test/LINQBridge.Tests/EnumerableFixture.cs
=======================================
--- /src/Enumerable.cs Sat Apr 30 06:00:17 2011
+++ /src/Enumerable.cs Sat Apr 30 06:02:19 2011
@@ -25,7 +25,7 @@
//
#endregion
-// $Id: Enumerable.cs 251 2011-01-17 07:34:22Z azizatif $
+// $Id: Enumerable.cs 253 2011-02-04 22:48:58Z azizatif $
namespace System.Linq
{
@@ -1311,6 +1311,9 @@
CheckNotNull(source, "source");
Debug.Assert(lesser != null);
+ if (typeof(TSource).IsClass) // ReSharper disable
CompareNonConstrainedGenericWithNull
+ source = source.Where(e => e != null).DefaultIfEmpty(); //
ReSharper restore CompareNonConstrainedGenericWithNull
+
return source.Aggregate((a, item) => lesser(a, item) ? a :
item);
}
=======================================
--- /test/LINQBridge.Tests/EnumerableFixture.cs Sat Apr 30 06:01:11 2011
+++ /test/LINQBridge.Tests/EnumerableFixture.cs Sat Apr 30 06:02:19 2011
@@ -1370,7 +1370,7 @@
[Test]
public void Min_StringsWithSelector_ReturnsMinimum()
{
- Assert.That(Read("the", "quick", "brown", "fox").Min(x => x == null ?
null : x.Last() + x), Is.EqualTo("ethe"));
+ Assert.That(Read("the", "quick", "brown", "fox").Min(x => x.Last() +
x), Is.EqualTo("ethe"));
}
[Test]
@@ -1385,6 +1385,20 @@
var strings = Read("five", "four", null, "three",
null, "two", "one", "zero");
Assert.That(strings.Min(s => s != null ? s.Length :
(int?)null), Is.EqualTo(3));
}
+
+ [Test(Description
= "
http://code.google.com/p/linqbridge/issues/detail?id=19")]
+ public void Min_EmptyStringSequence_ReturnsNull()
+ {
+ var strings = Read<string>();
+ Assert.That(strings.Min(), Is.Null);
+ }
+
+ [Test(Description
= "
http://code.google.com/p/linqbridge/issues/detail?id=19")]
+ public void Min_NonNullAndNullString_ReturnsNull()
+ {
+ var strings = Read("a", null);
+ Assert.That(strings.Min(), Is.EqualTo("a"));
+ }
[Test]
public void
OfType_EnumerableWithElementsOfDifferentTypes_OnlyDecimalsAreReturned()