public void Linq9_Customers_ReturnsGroupedProducts() { var expected = new List <(string city, int averageIncome, int averageIntensity)> { ("Berlin", 2022, 3), ("Mexico D.F.", 680, 2), ("London", 690, 1) }; var result = LinqTask.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(() => LinqTask.Linq9(null).ToList(), Throws.ArgumentNullException); }