public void Test_MarkedForDeleteChild_SavesWhenParentSaves()
        {
            //---------------Set up test pack-------------------
            OrganisationTestBO organisation = OrganisationTestBO.CreateSavedOrganisation();

            GetAssociationRelationship(organisation);
            ContactPersonTestBO contactPerson = ContactPersonTestBO.CreateUnsavedContactPerson();

            organisation.ContactPerson = contactPerson;
            contactPerson.Save();
            contactPerson.MarkForDelete();

            //---------------Execute Test ----------------------
            organisation.Save();

            //---------------Test Result -----------------------
            BOTestUtils.AssertBOStateIsValidAfterDelete(contactPerson);
        }
        public void Test_MarkedForDeleteChild_SavesWhenParentSaves()
        {
            //---------------Set up test pack-------------------
            OrganisationTestBO  organisationTestBO = OrganisationTestBO.CreateSavedOrganisation();
            ContactPersonTestBO contactPerson      = organisationTestBO.ContactPeople.CreateBusinessObject();
            RelationshipDef     relationshipDef    =
                (RelationshipDef)organisationTestBO.Relationships["ContactPeople"].RelationshipDef;

            relationshipDef.RelationshipType = RelationshipType.Association;
            contactPerson.Surname            = TestUtil.GetRandomString();
            contactPerson.FirstName          = TestUtil.GetRandomString();
            contactPerson.Save();
            contactPerson.MarkForDelete();

            //---------------Execute Test ----------------------
            organisationTestBO.Save();

            //---------------Test Result -----------------------
            BOTestUtils.AssertBOStateIsValidAfterDelete(contactPerson);
        }
 public override void TearDownTest()
 {
     //Drop the newly created ContactPersonTable (see above).
     BOTestUtils.DropNewContactPersonAndAddressTables();
 }
Ejemplo n.º 4
0
 public override void TearDownTest()
 {
     //runs every time any testmethod is complete
     //base.TearDownTest();
     BOTestUtils.DropNewContactPersonAndAddressTables();
 }
Ejemplo n.º 5
0
 protected virtual void CreateContactPersonTable()
 {
     _contactPersonTableName = BOTestUtils.CreateContactPersonTable(TestUtil.GetRandomString());
 }