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


C# BusinessObjectCollection.LoadWithLimit方法代码示例

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


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

示例1: Test_CollectionLoad_LoadWithLimit_FirstNegative_ThrowsError

 public void Test_CollectionLoad_LoadWithLimit_FirstNegative_ThrowsError()
 {
     const int totalRecords = 3;
     const int firstRecord = -1;
     const int limit = 0;
     SetupDefaultContactPersonBO();
     ContactPersonTestBO[] contactPersonTestBOs = CreateSavedContactPeople(totalRecords);
     BusinessObjectCollection<ContactPersonTestBO> col = new BusinessObjectCollection<ContactPersonTestBO>();
     //---------------Assert Precondition----------------
     Assert.AreEqual(totalRecords, contactPersonTestBOs.Length);
     //---------------Execute Test ----------------------
     try
     {
         int totalNoOfRecords;
         col.LoadWithLimit("", "Surname", firstRecord, limit, out totalNoOfRecords);
         //---------------Test Result -----------------------
         Assert.Fail("IndexOutOfRangeException exception expected");
     }
     catch (IndexOutOfRangeException ex)
     {
         Assert.AreEqual("FirstRecordToLoad should not be negative.", ex.Message);
     }
 }
开发者ID:kevinbosman,项目名称:habanero,代码行数:23,代码来源:TestBusinessObjectLoader_GetBusinessObjectCollection.cs

示例2: Test_CollectionLoad_LoadWithLimit_FirstAtEnd_LimitBeyondEnd_RefreshWithAdditionalBO

 public void Test_CollectionLoad_LoadWithLimit_FirstAtEnd_LimitBeyondEnd_RefreshWithAdditionalBO()
 {
     const int totalRecords = 5;
     const int firstRecord = totalRecords - 1;
     const int limit = 3;
     SetupDefaultContactPersonBO();
     var contactPersonTestBOs = CreateSavedContactPeople(totalRecords);
     var contactPersonTestBOsPlusOne = new ContactPersonTestBO[totalRecords + 1];
     contactPersonTestBOs.CopyTo(contactPersonTestBOsPlusOne, 0);
     var col = new BusinessObjectCollection<ContactPersonTestBO>();
     int totalNoOfRecords;
     col.LoadWithLimit("", "Surname", firstRecord, limit, out totalNoOfRecords);
     contactPersonTestBOsPlusOne[totalRecords] = ContactPersonTestBO.CreateSavedContactPerson
         ("ZZZZZZZZZZZZZZZZZ");
     //---------------Assert Precondition----------------
     Assert.AreEqual(1, col.Count);
     Assert.AreEqual(totalRecords, contactPersonTestBOs.Length);
     Assert.AreEqual(totalRecords + 1, contactPersonTestBOsPlusOne.Length);
     //---------------Execute Test ----------------------
     col.Refresh();
     //---------------Test Result -----------------------
     totalNoOfRecords++;
     AssertLimitedResultsCorrect
         (firstRecord, limit, totalRecords + 1, 2, contactPersonTestBOsPlusOne, col, totalNoOfRecords);
 }
开发者ID:kevinbosman,项目名称:habanero,代码行数:25,代码来源:TestBusinessObjectLoader_GetBusinessObjectCollection.cs

示例3: Test_CollectionLoad_LoadWithLimit_FirstAfterEnd_LimitZero

 public void Test_CollectionLoad_LoadWithLimit_FirstAfterEnd_LimitZero()
 {
     const int totalRecords = 3;
     const int firstRecord = 4;
     const int limit = 0;
     SetupDefaultContactPersonBO();
     var contactPersonTestBOs = CreateSavedContactPeople(totalRecords);
     var col = new BusinessObjectCollection<ContactPersonTestBO>();
     //---------------Assert Precondition----------------
     Assert.AreEqual(totalRecords, contactPersonTestBOs.Length);
     //---------------Execute Test ----------------------
     int totalNoOfRecords;
     col.LoadWithLimit("", "Surname", firstRecord, limit, out totalNoOfRecords);
     //---------------Test Result -----------------------
     AssertLimitedResultsCorrect
         (firstRecord, limit, totalRecords, 0, contactPersonTestBOs, col, totalNoOfRecords);
 }
开发者ID:kevinbosman,项目名称:habanero,代码行数:17,代码来源:TestBusinessObjectLoader_GetBusinessObjectCollection.cs

示例4: Test_CollectionLoad_LoadWithLimit_CriteriaObject_IncludesCriteriaMatchesWithinLimit

        public void Test_CollectionLoad_LoadWithLimit_CriteriaObject_IncludesCriteriaMatchesWithinLimit()
        {
            //---------------Set up test pack-------------------
            SetupDefaultContactPersonBO();
            DateTime now = DateTime.Now;
            ContactPersonTestBO cp1 = ContactPersonTestBO.CreateSavedContactPerson(now, "aaa");
            ContactPersonTestBO cpLast = ContactPersonTestBO.CreateSavedContactPerson(now, "zzz");
            ContactPersonTestBO cp2 = ContactPersonTestBO.CreateSavedContactPerson(now, "hhh");
            ContactPersonTestBO.CreateSavedContactPerson(DateTime.Now.AddDays(-3), "bbb");

            BusinessObjectCollection<ContactPersonTestBO> col = new BusinessObjectCollection<ContactPersonTestBO>();
            Criteria criteria = new Criteria("DateOfBirth", Criteria.ComparisonOp.GreaterThan, now.AddHours(-1));
            //---------------Assert Precondition ---------------


            //---------------Execute Test ----------------------
            //            BORegistry.DataAccessor.BusinessObjectLoader.Refresh(col);
            col.LoadWithLimit(criteria, "Surname", 2);

            //---------------Test Result -----------------------
            Assert.AreEqual(2, col.Count);
            Assert.AreSame(cp1, col[0]);
            Assert.AreSame(cp2, col[1]);
            Assert.IsFalse(col.Contains(cpLast));
        }
开发者ID:kevinbosman,项目名称:habanero,代码行数:25,代码来源:TestBusinessObjectLoader_GetBusinessObjectCollection.cs

示例5: Test_CollectionLoad_LoadWithLimit_FirstAfterStart_LimitBeforeEnd

 public void Test_CollectionLoad_LoadWithLimit_FirstAfterStart_LimitBeforeEnd()
     //_NoRecords_StartRecords_First2Records()
 {
     const int totalRecords = 6;
     const int firstRecord = 2;
     const int limit = 2;
     SetupDefaultContactPersonBO();
     ContactPersonTestBO[] contactPersonTestBOs = CreateSavedContactPeople(totalRecords);
     BusinessObjectCollection<ContactPersonTestBO> col = new BusinessObjectCollection<ContactPersonTestBO>();
     //---------------Assert Precondition----------------
     Assert.AreEqual(totalRecords, contactPersonTestBOs.Length);
     //---------------Execute Test ----------------------
     int totalNoOfRecords;
     col.LoadWithLimit("", "Surname", firstRecord, limit, out totalNoOfRecords);
     //---------------Test Result -----------------------
     AssertLimitedResultsCorrect
         (firstRecord, limit, totalRecords, limit, contactPersonTestBOs, col, totalNoOfRecords);
 }
开发者ID:kevinbosman,项目名称:habanero,代码行数:18,代码来源:TestBusinessObjectLoader_GetBusinessObjectCollection.cs

示例6: CreateCompositeContactPeople

 public void Test_CollectionLoad_LoadWithLimit_WithSortCriteriaNullString_WhenCompositePK_ShouldNotRaiseError_FixBug567()
 {
     ContactPersonCompositeKey.DeleteAllContactPeople();
     const int totalRecords = 6;
     const int firstRecord = 2;
     const int limit = 2;
     const int expectedCount = 2;
     ContactPersonCompositeKey.LoadClassDefs();
     ContactPersonCompositeKey[] contactPersonTestBOs = CreateCompositeContactPeople(totalRecords);
     IBusinessObjectCollection col = new BusinessObjectCollection<ContactPersonCompositeKey>();
     //---------------Assert Precondition----------------
     Assert.AreEqual(totalRecords, contactPersonTestBOs.Length);
     //---------------Execute Test ----------------------
     int totalNoOfRecords;
     col.LoadWithLimit((string)null, (string)null, firstRecord, limit, out totalNoOfRecords);
     //---------------Test Result -----------------------
     Assert.AreEqual
         (totalRecords, totalNoOfRecords, "The returned total number of availabe records is incorrect");
     Assert.AreEqual
         (firstRecord, col.SelectQuery.FirstRecordToLoad,
          "Collection query FirstRecordToLoad does not match expectation.");
     Assert.AreEqual
         (limit, col.SelectQuery.Limit, "Collection query limit does not match expectation.");
     Assert.AreEqual(expectedCount, col.Count, "Collection size does not match expectation.");
 }
开发者ID:kevinbosman,项目名称:habanero,代码行数:25,代码来源:TestBusinessObjectLoader_GetBusinessObjectCollection.cs

示例7: Test_CollectionLoad_LoadWithLimit_WithSortCriteriaEmptyString_ShouldNotRaiseError_FixBug566

 public void Test_CollectionLoad_LoadWithLimit_WithSortCriteriaEmptyString_ShouldNotRaiseError_FixBug566()
 {
     ContactPersonTestBO.DeleteAllContactPeople();
     const int totalRecords = 3;
     const int firstRecord = 0;
     const int limit = 2;
     const int expectedCount = 2;
     SetupDefaultContactPersonBO();
     ContactPersonTestBO[] contactPersonTestBOs = CreateSavedSortedContactPeople(totalRecords);
     IBusinessObjectCollection col = new BusinessObjectCollection<ContactPersonTestBO>();
     //---------------Assert Precondition----------------
     Assert.AreEqual(totalRecords, contactPersonTestBOs.Length);
     //---------------Execute Test ----------------------
     int totalNoOfRecords;
     col.LoadWithLimit("", "", firstRecord, limit, out totalNoOfRecords);
     //---------------Test Result -----------------------
     Assert.AreEqual
         (totalRecords, totalNoOfRecords, "The returned total number of availabe records is incorrect");
     Assert.AreEqual
         (firstRecord, col.SelectQuery.FirstRecordToLoad,
          "Collection query FirstRecordToLoad does not match expectation.");
     Assert.AreEqual
         (limit, col.SelectQuery.Limit, "Collection query limit does not match expectation.");
     Assert.AreEqual(expectedCount, col.Count, "Collection size does not match expectation.");
 }
开发者ID:kevinbosman,项目名称:habanero,代码行数:25,代码来源:TestBusinessObjectLoader_GetBusinessObjectCollection.cs

示例8: Test_CollectionLoad_LoadWithLimit_WithSearchCriteriaNullString_ShouldNotRaiseError_FixBug565

        public void Test_CollectionLoad_LoadWithLimit_WithSearchCriteriaNullString_ShouldNotRaiseError_FixBug565()
        {
            ContactPersonTestBO.DeleteAllContactPeople();
            const int totalRecords = 3;
            const int firstRecord = 0;
            const int limit = 2;
            const int expectedCount = 2;

            SetupDefaultContactPersonBO();
            ContactPersonTestBO[] contactPersonTestBOs = CreateSavedSortedContactPeople(totalRecords);
            IBusinessObjectCollection col = new BusinessObjectCollection<ContactPersonTestBO>();
            //---------------Assert Precondition----------------
            Assert.AreEqual(totalRecords, contactPersonTestBOs.Length);
            //---------------Execute Test ----------------------

            int totalNoOfRecords;
            col.LoadWithLimit((string)null, "Surname", firstRecord, limit, out totalNoOfRecords);
            //---------------Test Result -----------------------
            AssertLimitedResultsCorrect
                (firstRecord, limit, totalRecords, expectedCount, contactPersonTestBOs, col, totalNoOfRecords);
        }
开发者ID:kevinbosman,项目名称:habanero,代码行数:21,代码来源:TestBusinessObjectLoader_GetBusinessObjectCollection.cs

示例9: Test_CollectionLoad_LoadWithLimit_NoRecords2_StartRecord1_UsingWhereClause

        public void Test_CollectionLoad_LoadWithLimit_NoRecords2_StartRecord1_UsingWhereClause()
        {
            SetupDefaultContactPersonBO();
            ContactPersonTestBO cp1 = ContactPersonTestBO.CreateSavedContactPerson("eeeee");
            ContactPersonTestBO.CreateSavedContactPerson("gggggg");
            ContactPersonTestBO.CreateSavedContactPerson("gggdfasd");
            ContactPersonTestBO.CreateSavedContactPerson("bbbbbb");
            ContactPersonTestBO.CreateSavedContactPerson("zazaza");
            ContactPersonTestBO.CreateSavedContactPerson("zbbbbb");
            ContactPersonTestBO.CreateSavedContactPerson("zccccc");
            ContactPersonTestBO.CreateSavedContactPerson("zddddd");
            BusinessObjectCollection<ContactPersonTestBO> col = new BusinessObjectCollection<ContactPersonTestBO>();
            int totalNoOfRecords;
            //---------------Assert Precondition----------------

            //---------------Execute Test ----------------------
            col.LoadWithLimit("Surname Not Like 'z%'", "Surname", 1, 2, out totalNoOfRecords);
            //---------------Test Result -----------------------
            Assert.AreEqual(1, col.SelectQuery.FirstRecordToLoad);
            Assert.AreEqual(2, col.SelectQuery.Limit);
            Assert.AreEqual(2, col.Count);
            Assert.AreSame(cp1, col[0]);
        }
开发者ID:kevinbosman,项目名称:habanero,代码行数:23,代码来源:TestBusinessObjectLoader_GetBusinessObjectCollection.cs

示例10: Test_LoadWithLimit_LoadWithLimit_FirstAtEnd_LimitEqualsEnd

 public void Test_LoadWithLimit_LoadWithLimit_FirstAtEnd_LimitEqualsEnd()
 {
     const int totalRecords = 4;
     const int firstRecord = totalRecords - 1;
     const int limit = 1;
     ContactPersonTestBO.LoadDefaultClassDef();
     ContactPersonTestBO[] contactPersonTestBOs = CreateSavedSortedContactPeople(totalRecords);
     IBusinessObjectCollection col = new BusinessObjectCollection<ContactPersonTestBO>();
     //---------------Assert Precondition----------------
     Assert.AreEqual(totalRecords, contactPersonTestBOs.Length);
     //---------------Execute Test ----------------------
     int totalNoOfRecords;
     col.LoadWithLimit("", "Surname", firstRecord, limit, out totalNoOfRecords);
     //---------------Test Result -----------------------
     AssertLimitedResultsCorrect
         (firstRecord, limit, totalRecords, limit, contactPersonTestBOs, col, totalNoOfRecords);
 }
开发者ID:kevinbosman,项目名称:habanero,代码行数:17,代码来源:TestBusinessObjectCollection.cs


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