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); }
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); }
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); }
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); }