forked from SimonCropp/LocalDb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSnippetTests.cs
43 lines (37 loc) · 1.01 KB
/
SnippetTests.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
37
38
39
40
41
42
43
using System.Threading.Tasks;
using LocalDb;
using Xunit;
public class SnippetTests
{
static SqlInstance sqlInstance;
static SnippetTests()
{
sqlInstance = new SqlInstance(
name: "Snippets",
buildTemplate: TestDbBuilder.CreateTable);
}
#region Test
public async Task TheTest()
{
#region BuildDatabase
using (var database = await sqlInstance.Build())
{
#region BuildContext
await TestDbBuilder.AddData(database.Connection);
Assert.Single(await TestDbBuilder.GetData(database.Connection));
#endregion
}
#endregion
}
#endregion
public async Task TheTestWithDbName()
{
#region WithDbName
using (var database = await sqlInstance.Build("TheTestWithDbName"))
{
#endregion
await TestDbBuilder.AddData(database.Connection);
Assert.Single(await TestDbBuilder.GetData(database.Connection));
}
}
}