• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# ContactPersonTestBO类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中ContactPersonTestBO的典型用法代码示例。如果您正苦于以下问题:C# ContactPersonTestBO类的具体用法?C# ContactPersonTestBO怎么用?C# ContactPersonTestBO使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: CreateContactPersonTestBO

 private static ContactPersonTestBO CreateContactPersonTestBO()
 {
     ContactPersonTestBO bo = new ContactPersonTestBO();
     string newSurname = Guid.NewGuid().ToString();
     bo.Surname = newSurname;
     bo.Save();
     return bo;
 }
开发者ID:kevinbosman,项目名称:habanero,代码行数:8,代码来源:TestBusinessObjectCollection.cs


示例2: TestReloadingRelationship

        public void TestReloadingRelationship()
        {
            ClassDef.ClassDefs.Clear();
            ContactPersonTestBO.LoadClassDefWithAddressesRelationship_DeleteRelated();
            new AddressTestBO();

            ContactPersonTestBO cp = new ContactPersonTestBO();
            IBusinessObjectCollection addresses = cp.Addresses;
            Assert.AreSame(addresses, cp.Addresses);
        }
开发者ID:kevinbosman,项目名称:habanero,代码行数:10,代码来源:TestMultipleRelationship.cs


示例3: TestTypeOfMultipleCollection

        public void TestTypeOfMultipleCollection()
        {
            ClassDef.ClassDefs.Clear();
            ContactPersonTestBO.LoadClassDefWithAddressesRelationship_DeleteRelated();
            new AddressTestBO();

            ContactPersonTestBO cp = new ContactPersonTestBO();

            Assert.AreSame(typeof(RelatedBusinessObjectCollection<AddressTestBO>), cp.Addresses.GetType());
        }
开发者ID:kevinbosman,项目名称:habanero,代码行数:10,代码来源:TestMultipleRelationship.cs


示例4: CreateDirtyChildren

 protected void CreateDirtyChildren(BusinessObjectCollection<ContactPersonTestBO> cpCol,
                         out ContactPersonTestBO existingChild,
                         out ContactPersonTestBO editedChild,
                         out ContactPersonTestBO deletedChild,
                         out ContactPersonTestBO createdChildWithEdits,
                         out ContactPersonTestBO createdChild)
 {
     createdChild = CreateCreatedChild(cpCol);
     createdChildWithEdits = CreateCreatedChildWithEdits(cpCol);
     existingChild = CreateExistingChild(cpCol);
     editedChild = CreateEditedChild(cpCol);
     deletedChild = CreateDeletedChild(cpCol);
 }
开发者ID:kevinbosman,项目名称:habanero,代码行数:13,代码来源:TestMultipleRelationshipCancelEdits_Composition.cs


示例5: Test_Constructor

        public void Test_Constructor()
        {
            //---------------Set up test pack-------------------
            ContactPersonTestBO contactPersonTestBO = new ContactPersonTestBO();
            SingleRelationship<OrganisationTestBO> singleRelationship = contactPersonTestBO.Relationships.GetSingle<OrganisationTestBO>("Organisation");

            //---------------Execute Test ----------------------
            TransactionalSingleRelationship_Added tsr = new TransactionalSingleRelationship_Added(singleRelationship, new OrganisationTestBO());
            //---------------Test Result -----------------------

            Assert.AreSame(singleRelationship, tsr.Relationship);
            //---------------Tear Down -------------------------          
        }
开发者ID:kevinbosman,项目名称:habanero,代码行数:13,代码来源:TestTransactionalSingleRelationship.cs


示例6: Test_Create_WhenRelatedProp_ShouldCreateBOPropMapper

 public void Test_Create_WhenRelatedProp_ShouldCreateBOPropMapper()
 {
     //---------------Set up test pack-------------------
     const string propName = "Organisation.Name";
     var bo = new ContactPersonTestBO();
     //---------------Assert Precondition----------------
     Assert.IsTrue(bo.Relationships.Contains("Organisation"));
     //---------------Execute Test ----------------------
     IBOPropertyMapper propMapper = BOPropMapperFactory.CreateMapper(bo, propName);
     //---------------Test Result -----------------------
     Assert.IsInstanceOf<BOPropertyMapper>(propMapper);
     Assert.AreEqual(propName, propMapper.PropertyName);
     Assert.AreSame(bo, propMapper.BusinessObject);
 }
开发者ID:kevinbosman,项目名称:habanero,代码行数:14,代码来源:TestBOPropertyMapperFactory.cs


示例7: Test_SetToNull

 public void Test_SetToNull()
 {
     //---------------Set up test pack-------------------
     OrganisationTestBO organisationTestBO = OrganisationTestBO.CreateSavedOrganisation();
     SingleRelationship<ContactPersonTestBO> relationship = GetAssociationRelationship(organisationTestBO);
     relationship.OwningBOHasForeignKey = false;
     ContactPersonTestBO contactPerson = new ContactPersonTestBO();
     contactPerson.Surname = TestUtil.GetRandomString();
     contactPerson.FirstName = TestUtil.GetRandomString();
     contactPerson.Organisation = organisationTestBO;
     contactPerson.Save();
     //---------------Assert Precondition----------------
     Assert.AreSame(contactPerson, organisationTestBO.ContactPerson);
     //---------------Execute Test ----------------------
     organisationTestBO.ContactPerson = null;
     //---------------Test Result -----------------------
     Assert.IsNull(organisationTestBO.ContactPerson);
 }
开发者ID:kevinbosman,项目名称:habanero,代码行数:18,代码来源:TestSingleRelationship.cs


示例8: Test_BusinessObject

        public void Test_BusinessObject()
        {
            //---------------Set up test pack-------------------
            var readOnlyGrid = GetControlFactory().CreateReadOnlyGrid();

            const string propName = "Addresses";
            var mapper = CreateReadOnlyGridMapper(readOnlyGrid, propName);
            ContactPersonTestBO.LoadClassDefWithAddressesRelationship_DeleteRelated();
            ContactPersonTestBO contactPersonTestBO = new ContactPersonTestBO();
            RelatedBusinessObjectCollection<AddressTestBO> addresses = contactPersonTestBO.Addresses;
            //---------------Assert PreConditions---------------        
            Assert.IsNull(mapper.BusinessObject);

            //---------------Execute Test ----------------------
            mapper.BusinessObject = contactPersonTestBO;
            //---------------Test Result -----------------------
            Assert.AreSame(contactPersonTestBO, mapper.BusinessObject);
            Assert.AreSame(addresses, readOnlyGrid.BusinessObjectCollection);
        }
开发者ID:Chillisoft,项目名称:habanero.faces,代码行数:19,代码来源:TestReadOnlyGridMapper.cs


示例9: Test_AddMethod

 public void Test_AddMethod()
 {
     //---------------Set up test pack-------------------
     //ContactPersonTestBO.LoadDefaultClassDef();
     BusinessObjectCollection<ContactPersonTestBO> cpCol = new BusinessObjectCollection<ContactPersonTestBO>();
     ContactPersonTestBO myBO = new ContactPersonTestBO();
     _businessObjectCollectionTestHelper.RegisterForAddedEvent(cpCol);
     //---------------Assert Precondition----------------
     Assert.AreEqual(0, cpCol.Count);
     Assert.AreEqual(0, cpCol.AddedBusinessObjects.Count);
     _businessObjectCollectionTestHelper.AssertAddedEventNotFired();
     //---------------Execute Test ----------------------
     cpCol.Add(myBO);
     //---------------Test Result -----------------------
     Assert.AreEqual(1, cpCol.Count, "One object should be in the cpCollection");
     BusinessObjectCollectionTestHelper.AssertOneObjectInCurrentAndCreatedCollection(cpCol);
     _businessObjectCollectionTestHelper.AssertAddedEventFired();
     Assert.AreEqual(myBO, cpCol[0], "Added object should be in the cpCollection");
 }
开发者ID:kevinbosman,项目名称:habanero,代码行数:19,代码来源:TestBusinessObjectCollection_AddedBOs.cs


示例10: Test_ConcurrentSave

        public void Test_ConcurrentSave()
        {
            //---------------Set up test pack-------------------
            ClassDef.ClassDefs.Clear();
            var classDef = ContactPersonTestBO.LoadDefaultClassDef();
            FixtureEnvironment.ClearBusinessObjectManager();
            TestUtil.WaitForGC();
            
            //---------------Assert Precondition----------------

            //---------------Execute Test ----------------------
            Parallel.For(0, 1000, i =>
                                  {
                                      var person = new ContactPersonTestBO();
                                      person.Surname = RandomValueGen.GetRandomString(1, 10);
                                      person.Save();
                                  });

            //---------------Test Result -----------------------
        }
开发者ID:Chillisoft,项目名称:habanero,代码行数:20,代码来源:TestBOSave_Concurrency_FirebirdEmbedded.cs


示例11: Test_BusinessObject_WhenNull

        public void Test_BusinessObject_WhenNull()
        {
            //---------------Set up test pack-------------------
            IEditableGridControl editableGrid = GetControlFactory().CreateEditableGridControl();

            const string propName = "Addresses";
            EditableGridControlMapper mapper = new EditableGridControlMapper(editableGrid, propName, false, GetControlFactory());
            ContactPersonTestBO.LoadClassDefWithAddressesRelationship_DeleteRelated();
            ContactPersonTestBO contactPersonTestBO = new ContactPersonTestBO();
            mapper.BusinessObject = contactPersonTestBO;
            RelatedBusinessObjectCollection<AddressTestBO> addresses = contactPersonTestBO.Addresses;
            //---------------Assert PreConditions---------------        
            Assert.AreSame(contactPersonTestBO, mapper.BusinessObject);
            Assert.AreSame(addresses, editableGrid.BusinessObjectCollection);
            //---------------Execute Test ----------------------
            mapper.BusinessObject = null;
            //---------------Test Result -----------------------
            Assert.IsNull(mapper.BusinessObject);
            Assert.AreSame(null, editableGrid.BusinessObjectCollection);
        }
开发者ID:Chillisoft,项目名称:habanero.faces,代码行数:20,代码来源:TestEditableGridControlMapper.cs


示例12: Test_AddedToObjectManager

        public void Test_AddedToObjectManager()
        {
            //---------------Set up test pack-------------------
            ContactPersonTestBO.LoadDefaultClassDef();

            ContactPersonTestBO cp = new ContactPersonTestBO();
            BusinessObjectManager boMan = BusinessObjectManager.Instance;
            //---------------Assert Precondition----------------
            Assert.AreEqual(0, boMan.Count);

            //---------------Execute Test ----------------------
            cp.Surname = TestUtil.CreateRandomString();
            boMan.Add(cp);

            //---------------Test Result -----------------------
            Assert.AreEqual(1, boMan.Count);

            Assert.IsTrue(boMan.Contains(cp));
            Assert.IsTrue(boMan.Contains(cp.ID));
            Assert.IsTrue(boMan.Contains(cp.ID.GetObjectId()));
            Assert.AreSame(cp, boMan[cp.ID.GetObjectId()]);
            Assert.AreSame(cp, boMan[cp.ID]);
        }
开发者ID:kevinbosman,项目名称:habanero,代码行数:23,代码来源:TestBusObjectManager.cs


示例13: Test_UpdateStateAsCommitted

        public void Test_UpdateStateAsCommitted()
        {
            //---------------Set up test pack-------------------
            ContactPersonTestBO contactPersonTestBO = new ContactPersonTestBO();
            OrganisationTestBO organisationTestBO = new OrganisationTestBO();

            SingleRelationship<OrganisationTestBO> singleRelationship = contactPersonTestBO.Relationships.GetSingle<OrganisationTestBO>("Organisation");
            singleRelationship.SetRelatedObject(organisationTestBO);

            IRelationship relationship = organisationTestBO.Relationships.GetMultiple<ContactPersonTestBO>("ContactPeople");
            TransactionalSingleRelationship_Added tsr = new TransactionalSingleRelationship_Added(relationship, contactPersonTestBO);
            IBOProp relationshipProp = contactPersonTestBO.Props["OrganisationID"];
            
            //---------------Assert PreConditions--------------- 
            Assert.IsTrue(relationshipProp.IsDirty);
            Assert.AreNotEqual(relationshipProp.Value, relationshipProp.PersistedPropertyValue);
            
            //---------------Execute Test ----------------------
            tsr.UpdateStateAsCommitted();
            
            //---------------Test Result -----------------------
            Assert.IsFalse(relationshipProp.IsDirty);
            Assert.AreEqual(relationshipProp.Value, relationshipProp.PersistedPropertyValue);
        }
开发者ID:kevinbosman,项目名称:habanero,代码行数:24,代码来源:TestTransactionalSingleRelationship.cs


示例14: Test_SetBusinessObject_ShouldSetTextOnExtendedTextBox

 public void Test_SetBusinessObject_ShouldSetTextOnExtendedTextBox()
 {
     //--------------- Set up test pack ------------------
     ExtendedTextBoxMapper mapper = CreateExtendedLookupComboBoxMapper("Surname");
     ContactPersonTestBO businessObjectInfo = new ContactPersonTestBO();
     var expectedTextBoxValue = TestUtil.GetRandomString();
     businessObjectInfo.Surname = expectedTextBoxValue;
     //--------------- Test Preconditions ----------------
     Assert.IsNotNullOrEmpty(businessObjectInfo.Surname);
     //--------------- Execute Test ----------------------
     mapper.BusinessObject = businessObjectInfo;
     //--------------- Test Result -----------------------
     Assert.AreSame(businessObjectInfo, mapper.BusinessObject);
     IExtendedTextBox extendedTextBox = (IExtendedTextBox)mapper.Control;
     Assert.AreEqual(expectedTextBoxValue, extendedTextBox.Text, "Text should be set on TextBox");
 }
开发者ID:Chillisoft,项目名称:habanero.faces,代码行数:16,代码来源:TestExtendedTextBoxMapperWin.cs


示例15: Test_SetBusinessObject_OnInternalLookupComboBoxMapper

 public void Test_SetBusinessObject_OnInternalLookupComboBoxMapper()
 {
     //--------------- Set up test pack ------------------
     ExtendedTextBoxMapper mapper = CreateExtendedLookupComboBoxMapper("Surname");
     //--------------- Test Preconditions ----------------
     Assert.IsNull(mapper.BusinessObject);
     Assert.IsNull(mapper.BusinessObject);
     ContactPersonTestBO businessObjectInfo = new ContactPersonTestBO();
     //--------------- Execute Test ----------------------
     mapper.BusinessObject = businessObjectInfo;
     //--------------- Test Result -----------------------
     Assert.AreSame(businessObjectInfo, mapper.BusinessObject);
 }
开发者ID:Chillisoft,项目名称:habanero.faces,代码行数:13,代码来源:TestExtendedTextBoxMapperWin.cs


示例16: Test_ItemsShowingInComboBox

        public void Test_ItemsShowingInComboBox()
        {
            //--------------- Set up test pack ------------------

            ContactPersonTestBO contactPersonTestBO = new ContactPersonTestBO();
            contactPersonTestBO.Surname = TestUtil.GetRandomString();
            contactPersonTestBO.FirstName = TestUtil.GetRandomString();
            OrganisationTestBO.LoadDefaultClassDef();
            OrganisationTestBO.CreateSavedOrganisation();
            OrganisationTestBO.CreateSavedOrganisation();

            IControlFactory controlFactory = GetControlFactory();
            ExtendedTextBoxWin extendedTextBoxWin = new ExtendedTextBoxWin(controlFactory);
            const string propName = "OrganisationID";
            ExtendedTextBoxMapper mapper = new ExtendedTextBoxMapper(
                extendedTextBoxWin, propName, true, controlFactory);
            //--------------- Test Preconditions ----------------
            Assert.IsNull(mapper.BusinessObject);
            Assert.IsNull(mapper.BusinessObject);
          
            //--------------- Execute Test ----------------------
            mapper.BusinessObject = contactPersonTestBO;
            //--------------- Test Result -----------------------
            Assert.AreSame(contactPersonTestBO, mapper.BusinessObject);
            Assert.AreSame(contactPersonTestBO, mapper.BusinessObject);
//            Assert.AreEqual(2, mapper.LookupList.Count);
        }
开发者ID:Chillisoft,项目名称:habanero.faces,代码行数:27,代码来源:TestExtendedTextBoxMapperWin.cs


示例17: GetAssociationRelationship

 private static OrganisationTestBO CreateSavedOrganisation_WithOneValidRemovedContactPerson
     (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();
     organisationTestBO.Save();
     cpCol.Remove(contactPerson);
     return organisationTestBO;
 }
开发者ID:kevinbosman,项目名称:habanero,代码行数:14,代码来源:TestRelatedBOCol_Association.cs


示例18: Test_ApplyChangesToBusinessObject_WhenNewItemIsSelected_ShouldUpdateBusinessObjectWithSelectedValue

 public override void Test_ApplyChangesToBusinessObject_WhenNewItemIsSelected_ShouldUpdateBusinessObjectWithSelectedValue()
 {
     //---------------Set up test pack-------------------
     var cmbox = CreateComboBox();
     BusinessObjectCollection<OrganisationTestBO> boCol;
     var mapper = GetMapperBoColHasOneItem(cmbox, out boCol);
     var relatedBo = boCol[0];
     var newOrganisation = boCol.CreateBusinessObject();
     newOrganisation.Save();
     var person = new ContactPersonTestBO { Organisation = relatedBo };
     mapper.BusinessObject = person;
     //---------------Assert Precondition----------------
     Assert.AreNotSame(newOrganisation, person.Organisation);
     Assert.AreSame(person, mapper.BusinessObject);
     Assert.AreNotSame(newOrganisation, cmbox.SelectedItem, "Selected Item should not be set.");
     //---------------Execute Test ----------------------
     cmbox.SelectedItem = newOrganisation;
     Assert.AreSame(newOrganisation, cmbox.SelectedItem, "Selected Item should be set.");
     mapper.ApplyChangesToBusinessObject();
     //---------------Test Result -----------------------
     Assert.AreSame(newOrganisation, cmbox.SelectedItem);
     Assert.AreSame(newOrganisation, person.Organisation);
 }
开发者ID:Chillisoft,项目名称:habanero.faces,代码行数:23,代码来源:TestAutoLoadingRelationshipComboBoxMapperWin.cs


示例19: GetMapperBoColHasOneItem

        public override void Test_ApplyChangesToBusinessObject_WhenNewItemIsSelected_WhenSet_WhenRelationshipIsLevelsDeep_ShouldUpdateRelatedBusinessObjectWithSelectedValue()
        {
            //---------------Set up test pack-------------------
            ClassDef.ClassDefs.Clear();
            ContactPersonTestBO.LoadClassDefWithOrganisationAndAddressRelationships();
            OrganisationTestBO.LoadDefaultClassDef();
            AddressTestBO.LoadDefaultClassDef();

            const string relationshipName = "ContactPersonTestBO.Organisation";
            var mapper = GetMapperBoColHasOneItem(relationshipName);
            var cmbox = mapper.Control;
            var boCol = (BusinessObjectCollection<OrganisationTestBO>)mapper.BusinessObjectCollection;
            var person = new ContactPersonTestBO { Organisation = boCol[0] };
            var addressTestBO = new AddressTestBO { ContactPersonTestBO = person };
            
            var newOrganisation = new OrganisationTestBO();
            newOrganisation.Save();
            mapper.BusinessObject = addressTestBO;
            //---------------Assert Precondition----------------
            Assert.AreSame(addressTestBO, mapper.BusinessObject);
            Assert.AreSame(person.Organisation, cmbox.SelectedItem);
            Assert.AreNotSame(person.Organisation, newOrganisation);
            //---------------Execute Test ----------------------
            cmbox.SelectedItem = newOrganisation;
            Assert.AreSame(newOrganisation, cmbox.SelectedItem, "Selected Item should be set.");
            mapper.ApplyChangesToBusinessObject();
            //---------------Test Result -----------------------
            Assert.AreSame(newOrganisation, cmbox.SelectedItem);
            Assert.AreSame(newOrganisation, person.Organisation);
        }
开发者ID:Chillisoft,项目名称:habanero.faces,代码行数:30,代码来源:TestAutoLoadingRelationshipComboBoxMapperWin.cs


示例20: Test_GetBusinessObjectFromObjectManager_WriteNewProp

        public void Test_GetBusinessObjectFromObjectManager_WriteNewProp()
        {
            //---------------Set up test pack-------------------
            FixtureEnvironment.ClearBusinessObjectManager();
            ClassDef.ClassDefs.Clear();
            BORegistry.DataAccessor = new DataAccessorInMemory();
            ContactPersonTestBO.LoadClassDefWithSurnameAsPrimaryKey_WriteNew();
            ContactPersonTestBO contactPersonTestBO = new ContactPersonTestBO();
            string surname = TestUtil.GetRandomString();
            contactPersonTestBO.Surname = surname;
            PropDef propDef = new PropDef("PropName", typeof(string), PropReadWriteRule.ReadWrite, null);
            propDef.LookupList = new BusinessObjectLookupList(typeof(ContactPersonTestBO));
            //---------------Assert Precondition----------------

            //---------------Execute Test ----------------------
            IBusinessObject returnedBO = propDef.GetlookupBusinessObjectFromObjectManager(contactPersonTestBO.Surname);
            //---------------Test Result -----------------------
            Assert.AreSame(contactPersonTestBO, returnedBO);
        }
开发者ID:Chillisoft,项目名称:habanero,代码行数:19,代码来源:TestPropDef.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ContactPoint类代码示例发布时间:2022-05-24
下一篇:
C# ContactInfo类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap