public void TestThreeLevels() {
var em = new EntityManager(shouldConnect: false);
//Make two products - '100' and '200'
var product1 = em.CreateEntity<Product>();
product1.EntityAspect.AddToManager();
product1.ProductID = 100;
var product2 = em.CreateEntity<Product>();
product2.EntityAspect.AddToManager();
product2.ProductID = 200;
//Create an Order
var order = em.CreateEntity<Order>();
order.EntityAspect.AddToManager();
order.OrderID = 1;
//And one detail that is currently pointing to Product 100
var detail = em.CreateEntity<OrderDetail>();
detail.EntityAspect.AddToManager();
detail.ProductID = 100;
order.OrderDetails.Add(detail);
//Make an extra detail entity
var extra = em.CreateEntity<OrderDetailExtraDetail>();
extra.EntityAspect.AddToManager();
extra.DetailID = 3;
detail.OrderDetailRevisions.Add(extra);
//Sanity check to make sure the extra entity is how we expect it
Assert.AreEqual(1, extra.OrderID);
Assert.AreEqual(100, extra.ProductID);
Assert.AreEqual(3, extra.DetailID);
//Now switch the detail to Product 200. I would expect this change to cascade
// to its child (the extra detail). It sort of cascades but not in any sensible way...
detail.ProductID = 200;
//This fails: the order ID somehow got set to 200? But that was the Product ID not the Order ID
Assert.AreEqual(1, extra.OrderID);
//This also fails: The Product ID wasn't changed - it is still 100
Assert.AreEqual(200, extra.ProductID);
Assert.AreEqual(3, extra.DetailID);
}