public void TestLoad_ClassTableInheritance_Hierarchy()
        {
            //---------------Set up test pack-------------------
            FilledCircle.GetClassDefWithClassInheritanceHierarchy();
            FilledCircle filledCircle = FilledCircle.CreateSavedFilledCircle();

            //---------------Execute Test ----------------------
            FilledCircle loadedFilledCircle =
                BORegistry.DataAccessor.BusinessObjectLoader.GetBusinessObject <FilledCircle>(filledCircle.ID);

            //---------------Test Result -----------------------
            Assert.AreSame(filledCircle, loadedFilledCircle);
        }
예제 #2
0
        public void TestLoad_ClassTableInheritance_Hierarchy_Fresh()
        {
            //---------------Set up test pack-------------------
            FilledCircle.GetClassDefWithClassInheritanceHierarchy();
            FilledCircle filledCircle = FilledCircle.CreateSavedFilledCircle();

            //---------------Execute Test ----------------------
            FixtureEnvironment.ClearBusinessObjectManager();
            FilledCircle loadedFilledCircle =
                BORegistry.DataAccessor.BusinessObjectLoader.GetBusinessObject <FilledCircle>(filledCircle.ID);

            //---------------Test Result -----------------------
            Assert.AreNotSame(loadedFilledCircle, filledCircle);
            Assert.AreEqual(filledCircle.Radius, loadedFilledCircle.Radius);
            Assert.AreEqual(filledCircle.ShapeName, loadedFilledCircle.ShapeName);
            Assert.AreEqual(filledCircle.Colour, loadedFilledCircle.Colour);
        }
예제 #3
0
        public void TestLoad_ClassTableInheritance__GetBOAsParent_ThenGetBOAsShape_ThenGetAsCircle_ShouldLoadCircle()
        {
            //---------------Set up test pack-------------------
            FilledCircle.GetClassDefWithClassInheritanceHierarchy();
            Circle circle = Circle.CreateSavedCircle();

            FixtureEnvironment.ClearBusinessObjectManager();
            //---------------Assert Preconditions---------------
            //---------------Execute Test ----------------------
            Shape  circleLoadedAsShape = BORegistry.DataAccessor.BusinessObjectLoader.GetBusinessObject <Shape>("ShapeID = " + circle.ShapeID);
            Circle loadedCircle        =
                BORegistry.DataAccessor.BusinessObjectLoader.GetBusinessObject <Circle>(circle.ID);

            //---------------Test Result -----------------------
            Assert.IsNotNull(circleLoadedAsShape);
            Assert.AreEqual(circle.ShapeName, circleLoadedAsShape.ShapeName);

            Assert.IsNotNull(loadedCircle);
            Assert.AreNotSame(loadedCircle, circle);
            Assert.AreNotSame(loadedCircle, circleLoadedAsShape, "This assertion is wrong, but represents the current way that the loader works");
            Assert.AreEqual(circle.Radius, loadedCircle.Radius);
            Assert.AreEqual(circle.ShapeName, loadedCircle.ShapeName);
        }