コード例 #1
0
        private static void VerifyAggregateListExitOperation <T>(AggregationFunc aggregation, IList <T> input, IList <T> expected, string description)
        {
            var listExitOperation = new ListExitOperation(null, 0, false, aggregation, null);
            var result            = listExitOperation.Execute(input);

            Assert.That(result, Is.EqualTo(expected), description);
        }
コード例 #2
0
        private static void VerifyMaxResultsOperation <T>(int maxResults, IList <T> input, IList <T> expected, string description)
        {
            var listExitOperation = new ListExitOperation(maxResults, 0, false, null, null);
            var result            = listExitOperation.Execute(input).ToList();

            Assert.That(result, Is.EqualTo(expected), description);
        }
コード例 #3
0
        private static void VerifyOrderedListExitOperation <T>(IEnumerable <SortOrder> orders, IList <T> input, IList <T> expected, string description)
        {
            var comparer          = new SortOrderComparer(orders);
            var listExitOperation = new ListExitOperation(null, 0, false, null, comparer);
            var result            = listExitOperation.Execute(input);

            Assert.That(result, Is.EqualTo(expected) & Is.Ordered.Using((IComparer)comparer), description);
        }
コード例 #4
0
        private static void VerifyAverageListExitOperation <T>(IList <T> input, IList <T> expected, string description)
        {
            AggregationFunc averageFunc = c => c.Average(
                arr => (double?)((object[])arr)[0],
                arr => (int?)((object[])arr)[1]);
            var listExitOperation = new ListExitOperation(null, 0, false, averageFunc, null);
            var result            = listExitOperation.Execute(input);

            Assert.That(result, Is.EqualTo(expected), description);
        }