当前位置: 首页>>代码示例>>C#>>正文


C# ContactPersonTestBO.MarkForDelete方法代码示例

本文整理汇总了C#中ContactPersonTestBO.MarkForDelete方法的典型用法代码示例。如果您正苦于以下问题:C# ContactPersonTestBO.MarkForDelete方法的具体用法?C# ContactPersonTestBO.MarkForDelete怎么用?C# ContactPersonTestBO.MarkForDelete使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ContactPersonTestBO的用法示例。


在下文中一共展示了ContactPersonTestBO.MarkForDelete方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetAssociationRelationship

        private static OrganisationTestBO CreateSavedOrganisation_WithOneMarkForDeleteContactPerson
            (out ContactPersonTestBO contactPerson, out MultipleRelationship<ContactPersonTestBO> relationship)
        {
            OrganisationTestBO organisationTestBO = OrganisationTestBO.CreateSavedOrganisation();
            BusinessObjectCollection<ContactPersonTestBO> cpCol;
            relationship = GetAssociationRelationship(organisationTestBO, out cpCol);
            contactPerson = ContactPersonTestBO.CreateSavedContactPerson
                (TestUtil.GetRandomString(), TestUtil.GetRandomString());
            cpCol.Add(contactPerson);
            cpCol.SaveAll();
            contactPerson.MarkForDelete();
            return organisationTestBO;












        }
开发者ID:kevinbosman,项目名称:habanero,代码行数:25,代码来源:TestRelatedBOCol_Association.cs

示例2: Test_GetDirtyChildren_MarkedForDelete

        public void Test_GetDirtyChildren_MarkedForDelete()
        {
            //---------------Set up test pack-------------------
            OrganisationTestBO organisationTestBO = OrganisationTestBO.CreateSavedOrganisation();
            SingleRelationship<ContactPersonTestBO> relationship = GetCompositionRelationship(organisationTestBO);
            ContactPersonTestBO myBO = new ContactPersonTestBO();
            myBO.Surname = TestUtil.GetRandomString();
            myBO.FirstName = TestUtil.GetRandomString();
            myBO.Organisation = organisationTestBO;
            organisationTestBO.Save();
            myBO.MarkForDelete();

            //---------------Execute Test ----------------------

            IList<ContactPersonTestBO> dirtyChildren = relationship.GetDirtyChildren();

            //---------------Test Result -----------------------
            Assert.Contains(myBO, (ICollection)dirtyChildren);
            Assert.AreEqual(1, dirtyChildren.Count);
        }
开发者ID:kevinbosman,项目名称:habanero,代码行数:20,代码来源:TestSingleRelationship_Composition.cs

示例3: Test_RestoreAll

        public void Test_RestoreAll()
        {
            ContactPersonTestBO.LoadDefaultClassDef();
            ContactPersonTestBO contact1 = new ContactPersonTestBO {Surname = "Soap"};
            ContactPersonTestBO contact2 = new ContactPersonTestBO {Surname = "Hope"};
            BusinessObjectCollection<ContactPersonTestBO> col = new BusinessObjectCollection<ContactPersonTestBO> {contact1, contact2};
            col.SaveAll();

            Assert.AreEqual("Soap", col[0].Surname);
            Assert.AreEqual("Hope", col[1].Surname);

            contact1.Surname = "Cope";
            contact2.Surname = "Pope";
            Assert.AreEqual("Cope", col[0].Surname);
            Assert.AreEqual("Pope", col[1].Surname);

            col.CancelEdits();
            Assert.AreEqual("Soap", col[0].Surname);
            Assert.AreEqual("Hope", col[1].Surname);

            contact1.MarkForDelete();
            contact2.MarkForDelete();
            col.SaveAll();
            Assert.AreEqual(0, col.Count);
        }
开发者ID:kevinbosman,项目名称:habanero,代码行数:25,代码来源:TestBusinessObjectCollection.cs

示例4: Test_DirtyIfHasMarkForDeleteChildren

        public void Test_DirtyIfHasMarkForDeleteChildren()
        {
            //---------------Set up test pack-------------------
            OrganisationTestBO organisationTestBO = OrganisationTestBO.CreateSavedOrganisation();
            SingleRelationship<ContactPersonTestBO> relationship = GetCompositionRelationship(organisationTestBO);
            ContactPersonTestBO myBO = new ContactPersonTestBO();
            myBO.Surname = TestUtil.GetRandomString();
            myBO.FirstName = TestUtil.GetRandomString();
            myBO.Organisation = organisationTestBO;
            organisationTestBO.Save();

            //---------------Assert Precondition----------------
            Assert.IsFalse(relationship.IsDirty);

            //---------------Execute Test ----------------------
            myBO.MarkForDelete();
            bool isDirty = relationship.IsDirty;

            //---------------Test Result -----------------------
            Assert.IsTrue(isDirty);
        }
开发者ID:kevinbosman,项目名称:habanero,代码行数:21,代码来源:TestSingleRelationship_Composition.cs

示例5: DoTestCheckForDuplicateObjects

 private static void DoTestCheckForDuplicateObjects()
 {
     ContactPersonTestBO contactPersonCompositeKey = GetSavedContactPersonCompositeKey();
     FixtureEnvironment.ClearBusinessObjectManager();
     ContactPersonTestBO duplicateContactPerson = new ContactPersonTestBO
                                                      {
                                                          ContactPersonID = Guid.NewGuid(),
                                                          Surname = contactPersonCompositeKey.Surname,
                                                          FirstName = contactPersonCompositeKey.FirstName
                                                      };
     TransactionCommitterDB committer = new TransactionCommitterDB(DatabaseConnection.CurrentConnection);
     committer.AddBusinessObject(duplicateContactPerson);
     //---------------Execute Test ----------------------
     try
     {
         committer.CommitTransaction();
         Assert.Fail();
     }
         //---------------Test Result -----------------------
     catch (BusObjDuplicateConcurrencyControlException ex)
     {
         StringAssert.Contains("Surname", ex.Message);
         StringAssert.Contains("FirstName", ex.Message);
     }
     finally
     {
         //---------------Tear Down--------------------------
         contactPersonCompositeKey.MarkForDelete();
         contactPersonCompositeKey.Save();
         if (!duplicateContactPerson.Status.IsNew)
         {
             duplicateContactPerson.MarkForDelete();
             duplicateContactPerson.Save();
         }
     }
 }
开发者ID:kevinbosman,项目名称:habanero,代码行数:36,代码来源:TestTransactionCommitterDB.cs


注:本文中的ContactPersonTestBO.MarkForDelete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。