从山证v2.3.0拷贝
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
using System.Data;
|
||||
|
||||
namespace YLErp.Modules.BaseModule
|
||||
{
|
||||
[TestClass]
|
||||
public class PagedQueryTest
|
||||
{
|
||||
[TestMethod]
|
||||
public void Test1()
|
||||
{
|
||||
var list = new List<string> { "333", "222", "111", "555" };
|
||||
var pagedList1 = list.AsQueryable().ToPagedList(new PagedQueryModel { PageSize = 2 });
|
||||
Assert.AreEqual(pagedList1.Count(), 2);
|
||||
|
||||
var query = DbContextFactory.GetYLDbContext().AppConfig.Where(n => n.PName.Contains("Erp"));
|
||||
var pagedList2 = query.ToPagedList(new PagedQueryModel { SortExpression = "PName", PageSize = 3 });
|
||||
Assert.AreEqual(pagedList2.Count(), 3);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user