Exemplo n.º 1
0
        public void Linq2UsingGroup_CustomersAndSuppliers_2CustomersHaveSuppliers()
        {
            var result = SelectExtensions.Linq2UsingGroup(DataSource.Customers, DataSource.Suppliers).ToList();

            Assert.That(() => result.Count, Is.EqualTo(DataSource.Customers.Count));
            foreach (var(customer, suppliers) in result)
            {
                if (suppliers.All(x => x is null))
                {
                    continue;
                }

                foreach (var supplier in suppliers)
                {
                    StringAssert.AreEqualIgnoringCase(customer.City, supplier.City);
                    StringAssert.AreEqualIgnoringCase(customer.Country, supplier.Country);
                }
            }
        }
Exemplo n.º 2
0
 public void Linq2UsingGroup_NullCustomer_ThrowsArgumentNullException()
 {
     Assert.That(() => SelectExtensions.Linq2UsingGroup(null, null).ToList(), Throws.ArgumentNullException);
 }