protected override void SetupInheritanceSpecifics() { CircleNoPrimaryKey.GetClassDef().SuperClassDef = new SuperClassDef(Shape.GetClassDef(), ORMapping.SingleTableInheritance); CircleNoPrimaryKey.GetClassDef().SuperClassDef.Discriminator = "ShapeType_field"; FilledCircleInheritsCircleNoPK.GetClassDef().SuperClassDef = new SuperClassDef(CircleNoPrimaryKey.GetClassDef(), ORMapping.ClassTableInheritance); }
public void TestSuperClassKey() { IBOKey msuperKey = BOPrimaryKey.GetSuperClassKey((ClassDef)FilledCircleInheritsCircleNoPK.GetClassDef(), _filledCircle); Assert.IsFalse(msuperKey.Contains("CircleID"), "Super class key should not contain the CircleID property"); Assert.IsTrue(msuperKey.Contains("ShapeID"), "Super class key should contain the ShapeID property"); Assert.AreEqual(1, msuperKey.Count, "Super class key should only have one prop"); Assert.AreEqual(_filledCircle.Props["ShapeID"].Value, //msuperKey["ShapeID"].Value, _filledCircle.ID["FilledCircleID"].Value, "ShapeID and FilledCircleID should be the same"); }
public void TestFilledCircleIsUsingCorrectInheritance() { Assert.AreEqual(ORMapping.SingleTableInheritance, CircleNoPrimaryKey.GetClassDef().SuperClassDef.ORMapping); Assert.AreEqual(ORMapping.ClassTableInheritance, FilledCircleInheritsCircleNoPK.GetClassDef().SuperClassDef.ORMapping); }