21 lines
684 B
C#
21 lines
684 B
C#
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);
|
|
}
|
|
}
|
|
}
|