-
-
Notifications
You must be signed in to change notification settings - Fork 514
/
Copy pathExecutionTests.cs
36 lines (33 loc) · 1.04 KB
/
ExecutionTests.cs
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
36
using System;
using SqlKata.Execution;
using Xunit;
namespace SqlKata.Tests
{
public class ExecutionTests
{
[Fact]
public void ShouldThrowException()
{
Assert.Throws<InvalidOperationException>(() =>
{
new Query("Books").Get();
});
}
[Fact]
public void TimeoutShouldBeCarriedToNewCreatedFactory()
{
var db = new QueryFactory();
db.QueryTimeout = 4000;
var newFactory = QueryExtensions.CreateQueryFactory(db.Query());
Assert.Equal(db.QueryTimeout, newFactory.QueryTimeout);
}
[Fact(Skip = "timeout over cloned xQuery is not supported yet")]
public void TimeoutShouldBeCarriedToNewCreatedFactoryAfterClone()
{
var db = new QueryFactory();
db.QueryTimeout = 4000;
var newFactory = QueryExtensions.CreateQueryFactory(db.Query().Clone());
Assert.Equal(db.QueryTimeout, newFactory.QueryTimeout);
}
}
}