public void TestCustomersIncludeOrdersAndDetails() { NorthwindDataContext nw = new NorthwindDataContext(this.Northwind.Provider.New(new TestPolicy("Orders", "Details"))); var custs = nw.List<Customer>().Where(c => c.CustomerID == "ALFKI").ToList(); Assert.AreEqual(1, custs.Count); Assert.AreNotEqual(null, custs[0].Orders); Assert.AreEqual(6, custs[0].Orders.Count); Assert.IsTrue(custs[0].Orders.Any(o => o.OrderID == 10643)); Assert.AreNotEqual(null, custs[0].Orders.Single(o => o.OrderID == 10643).Details); Assert.AreEqual(3, custs[0].Orders.Single(o => o.OrderID == 10643).Details.Count); }
public void TestCustomersIncludeOrders() { NorthwindDataContext nw = new NorthwindDataContext(this.Northwind.Provider.New(new TestPolicy("Orders"))); var custs = nw.List<Customer>().Where(c => c.CustomerID == "ALFKI").ToList(); Assert.AreEqual(1, custs.Count); Assert.AreNotEqual(null, custs[0].Orders); Assert.AreEqual(6, custs[0].Orders.Count); }