-
-
Notifications
You must be signed in to change notification settings - Fork 524
Expand file tree
/
Copy pathSqlServerJoinTests.cs
More file actions
35 lines (28 loc) · 1008 Bytes
/
SqlServerJoinTests.cs
File metadata and controls
35 lines (28 loc) · 1008 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
28
29
30
31
32
33
34
35
using SqlKata.Compilers;
using SqlKata.Tests.Infrastructure;
using Xunit;
namespace SqlKata.Tests.SqlServer
{
public class SqlServerJoinTests : TestSupport
{
private readonly SqlServerCompiler compiler;
public SqlServerJoinTests()
{
compiler = Compilers.Get<SqlServerCompiler>(EngineCodes.SqlServer);
}
[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));
}
}
}