public void Linq9_Customers_ReturnsGroupedProducts() { var expected = new List <(string city, int averageIncome, int averageIntensity)> { ("Berlin", 674, 3), ("Mexico D.F.", 292, 2), ("London", 690, 1), }; var result = SelectExtensions.Linq9(DataSource.Customers).ToList(); foreach (var valueTuple in result) { var expectedValue = expected.Single(_ => _.city == valueTuple.city); Assert.That(expectedValue.averageIncome, Is.EqualTo(valueTuple.averageIncome)); Assert.That(expectedValue.averageIntensity, Is.EqualTo(valueTuple.averageIntensity)); } }
public void Linq9_NullCustomers_ThrowsArgumentNullException() { Assert.That(() => SelectExtensions.Linq9(null).ToList(), Throws.ArgumentNullException); }