-
-
Notifications
You must be signed in to change notification settings - Fork 524
Expand file tree
/
Copy pathPostgreServerJoinTests.cs
More file actions
35 lines (28 loc) · 1 KB
/
PostgreServerJoinTests.cs
File metadata and controls
35 lines (28 loc) · 1 KB
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
28
29
30
31
32
33
34
35
using SqlKata.Compilers;
using SqlKata.Tests.Infrastructure;
using Xunit;
namespace SqlKata.Tests.PostgreSql
{
public class PostgreServerJoinTests : TestSupport
{
private readonly PostgresCompiler compiler;
public PostgreServerJoinTests()
{
compiler = Compilers.Get<PostgresCompiler>(EngineCodes.PostgreSql);
}
[Fact]
public void Join()
{
var query = new Query("Table").Join("TableA", "Column1", "ColumnA");
var ctx = new SqlResult { Query = query };
Assert.Equal("\nINNER JOIN \"TableA\" ON \"Column1\" = \"ColumnA\"", compiler.CompileJoins(ctx));
}
[Fact]
public void JoinWithIndexHint()
{
var query = new Query("Table").Join("TableA", "Column1", "ColumnA", indexHint: "index1");
var ctx = new SqlResult { Query = query };
Assert.Equal("\nINNER JOIN \"TableA\" ON \"Column1\" = \"ColumnA\"", compiler.CompileJoins(ctx));
}
}
}