-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathxTestPostgreSQL.cs
More file actions
27 lines (24 loc) · 895 Bytes
/
Copy pathxTestPostgreSQL.cs
File metadata and controls
27 lines (24 loc) · 895 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
using System;
using System.Collections.Generic;
using System.Text;
using Xunit;
using Dapper;
namespace IdentityServer.Dapper.xUnitTest
{
public class xTestPostgreSQL
{
[Fact]
public void TestGetPageQuerySQL()
{
var options = xTestBase.GetDBProviderOptions(xTestBase.PostgreSQL);
int pageIndex = 1;
int pageSize = 10;
int totalCount = 499;
string orderby = "order by id";
DynamicParameters dynamicParameters = new DynamicParameters();
string pagedsql = options.GetPageQuerySQL("select * from ApiResources where 1 = 1", pageIndex, pageSize, totalCount, orderby, dynamicParameters);
Assert.False(string.IsNullOrEmpty(pagedsql));
Assert.Equal("select * from ApiResources where 1 = 1 order by id limit @size offset @start", pagedsql);
}
}
}