forked from smartstore/SmartStoreNET
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGlobalSetup.cs
More file actions
35 lines (32 loc) · 862 Bytes
/
Copy pathGlobalSetup.cs
File metadata and controls
35 lines (32 loc) · 862 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 System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Text;
using NUnit.Framework;
using SmartStore.Data.Migrations;
namespace SmartStore.Data.Tests
{
[SetUpFixture]
public class GlobalSetup
{
[SetUp]
public void SetUp()
{
var ctx = new SmartObjectContext(GetTestDbName());
Database.SetInitializer(new DropCreateDatabaseAlways<SmartObjectContext>());
ctx.Database.Initialize(true);
}
[TearDown]
public void TearDown()
{
var ctx = new SmartObjectContext(GetTestDbName());
ctx.Database.Delete();
}
public static string GetTestDbName()
{
string testDbName = "Data Source=" + (System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location)) + @"\SmartStore.Data.Tests.Db.sdf;Persist Security Info=False";
return testDbName;
}
}
}