-
-
Notifications
You must be signed in to change notification settings - Fork 121
Expand file tree
/
Copy pathTestSetup.cs
More file actions
23 lines (22 loc) · 875 Bytes
/
Copy pathTestSetup.cs
File metadata and controls
23 lines (22 loc) · 875 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
using System.Data.Entity;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using SQLite.CodeFirst.NetCore.Console;
namespace SQLite.CodeFirst.Test
{
/// <summary>
/// Registers the SQLite Entity Framework 6 provider once for the whole test assembly.
/// On .NET (Core) there is no app.config based provider discovery, so the code based
/// <see cref="Configuration"/> from the demo project is applied before any test runs.
/// Setting it explicitly (instead of relying on assembly scanning) makes the registration
/// independent of which DbContext the test runner happens to touch first.
/// </summary>
[TestClass]
public static class TestSetup
{
[AssemblyInitialize]
public static void Initialize(TestContext context)
{
DbConfiguration.SetConfiguration(new Configuration());
}
}
}