Creating test databases during each test

This commit is contained in:
Sebastien Ros 2011-10-03 13:53:44 -07:00
parent 4420bc5ee4
commit a455d0c89f
3 changed files with 3 additions and 3 deletions

View File

@ -24,7 +24,6 @@ namespace Orchard.Tests.Modules {
[TestFixtureSetUp]
public void InitFixture() {
_databaseFilePath = Path.GetTempFileName();
}
[TestFixtureTearDown]
@ -34,6 +33,7 @@ namespace Orchard.Tests.Modules {
[SetUp]
public virtual void Init() {
_databaseFilePath = Path.GetTempFileName();
_sessionFactory = DataUtility.CreateSessionFactory(_databaseFilePath, DatabaseTypes.ToArray());
_session = _sessionFactory.OpenSession();
_clock = new StubClock();

View File

@ -14,11 +14,11 @@ namespace Orchard.Tests.Data {
[TestFixtureSetUp]
public void InitFixture() {
_databaseFilePath = Path.GetTempFileName();
}
[SetUp]
public void Init() {
_databaseFilePath = Path.GetTempFileName();
_sessionFactory = DataUtility.CreateSessionFactory(_databaseFilePath, typeof(FooRecord));
_session = _sessionFactory.OpenSession();
_fooRepos = new Repository<FooRecord>(new StubLocator(_session));

View File

@ -24,7 +24,6 @@ namespace Orchard.Tests {
[TestFixtureSetUp]
public void InitFixture() {
_databaseFilePath = Path.GetTempFileName();
}
[TestFixtureTearDown]
@ -34,6 +33,7 @@ namespace Orchard.Tests {
[SetUp]
public virtual void Init() {
_databaseFilePath = Path.GetTempFileName();
_sessionFactory = DataUtility.CreateSessionFactory(_databaseFilePath, DatabaseTypes.ToArray());
_session = _sessionFactory.OpenSession();
_clock = new StubClock();