-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathConnectionTest.cs
More file actions
46 lines (36 loc) · 1.07 KB
/
ConnectionTest.cs
File metadata and controls
46 lines (36 loc) · 1.07 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
36
37
38
39
40
41
42
43
44
45
46
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Data;
using DirectSQL.SqlLite;
using System.Threading.Tasks;
namespace TestSqlLiteDatabase
{
[TestClass]
public class ConnectionTest
{
[TestMethod]
public void TestConnect()
{
SqlLiteDatabase db = new SqlLiteDatabase("Data Source=:memory:");
db.Process((connection) => {
});
db.Process( (connection, transaction) =>
{
});
}
[TestMethod]
public void TestConnectAsync()
{
SqlLiteDatabase db = new SqlLiteDatabase("Data Source=:memory:");
Task task1 = db.ProcessAsync(async (connection) =>
{
await Task.Delay(1); //Dummy code to resolve warning in build.
});
task1.Wait();
Task task2 = db.ProcessAsync( async (connection, transaction) =>
{
await Task.Delay(1); //Dummy code to resolve warning in build.
});
task2.Wait();
}
}
}