Пример #1
0
        public static IEnumerable <object[]> BinaryFailingOperators()
        {
            Labeled <Operation> failing = Label("Failing", (start, count, s) => s(start, count).Select <int, int>(x => { throw new DeliberateTestException(); }));

            foreach (Labeled <Operation> operation in BinaryOperations(LabeledDefaultSource))
            {
                yield return(new object[] { LabeledDefaultSource.Append(failing), operation });

                yield return(new object[] { Failing, operation });
            }

            foreach (Labeled <Operation> operation in new[]
            {
                Label("Except-Fail", (start, count, s) => s(start, count).Except(DefaultSource(start, count), new FailingEqualityComparer <int>())),
                Label("GroupJoin-Fail", (start, count, s) => s(start, count).GroupJoin(DefaultSource(start, count), x => x, y => y, (x, g) => x, new FailingEqualityComparer <int>())),
                Label("Intersect-Fail", (start, count, s) => s(start, count).Intersect(DefaultSource(start, count), new FailingEqualityComparer <int>())),
                Label("Join-Fail", (start, count, s) => s(start, count).Join(DefaultSource(start, count), x => x, y => y, (x, y) => x, new FailingEqualityComparer <int>())),
                Label("Union-Fail", (start, count, s) => s(start, count).Union(DefaultSource(start, count), new FailingEqualityComparer <int>())),
                Label("Zip-Fail", (start, count, s) => s(start, count).Zip <int, int, int>(DefaultSource(start, count), (x, y) => { throw new DeliberateTestException(); })),
            })
            {
                yield return(new object[] { LabeledDefaultSource, operation });
            }
        }
Пример #2
0
 public static Labeled <Operation> AsOrdered(this Labeled <Operation> query)
 {
     return(query.Append(Label("AsOrdered", (start, count, source) => source(start, count).AsOrdered())));
 }