Esempio n. 1
0
        public void TestIntermediateClassRemove2()
        {
            TableNode tn;

            PrepareOrderDetails(out tn);

            TreeNodeCollection nodes = ApplicationController.Instance.DatabaseNode.Nodes;

            TableNode tnOrders   = (TableNode)FindNode(nodes, "Orders");
            TableNode tnProducts = (TableNode)FindNode(nodes, "Products");

            tnProducts.UnmapClass(null, EventArgs.Empty);

            Assertion.Assert("Mapping type wrong #1", tn.Table.MappingType == TableMappingType.NotMapped);

            RelationNode rn = tn.FindRelationNode("OrderID", "Orders");

            Assertion.AssertNull("Relation to Orders should be removed", rn);
            rn = tn.FindRelationNode("ProductID", "Products");
            Assertion.AssertNull("Relation to Products should be removed", rn);

            rn = tnOrders.FindRelationNode("OrderID", "Order Details");
            Assertion.AssertNull("Relation should be removed", rn);
//			ApplicationController.Instance.GenerateAssembly();
        }