Exemplo n.º 1
0
        public void Linq5_Customers_CustomersAndDateOfEntry()
        {
            var result = SelectExtensions.Linq5(DataSource.Customers).ToList();

            Assert.That(() => result.Count, Is.EqualTo(DataSource.Customers.Count - 1));
            foreach (var(customer, dateOfEntry) in result)
            {
                Assert.That(FindCustomerOrdersMinDate(customer), Is.EqualTo(dateOfEntry));
            }

            Assert.That(result[0].customer, Is.EqualTo(DataSource.Customers[1]));
            Assert.That(result[1].customer, Is.EqualTo(DataSource.Customers[3]));
            Assert.That(result[2].customer, Is.EqualTo(DataSource.Customers[2]));
            Assert.That(result[3].customer, Is.EqualTo(DataSource.Customers[4]));
            Assert.That(result[4].customer, Is.EqualTo(DataSource.Customers[0]));
        }
Exemplo n.º 2
0
 public void Linq5_NullCustomer_ThrowsArgumentNullException()
 {
     Assert.That(() => SelectExtensions.Linq5(null).ToList(), Throws.ArgumentNullException);
 }