mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-04-05 21:01:35 +08:00
Creating test databases during each test
This commit is contained in:
parent
4420bc5ee4
commit
a455d0c89f
@ -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();
|
||||
|
@ -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));
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user