mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-16 10:03:51 -07:00
Some minor clean-up.
This commit is contained in:
parent
50a8af0842
commit
910efb5941
7 changed files with 18 additions and 21 deletions
|
@ -1,4 +1,5 @@
|
|||
using System.IO;
|
||||
using System;
|
||||
using System.IO;
|
||||
using NUnit.Framework;
|
||||
using Ninject;
|
||||
using NzbDrone.Common;
|
||||
|
@ -35,24 +36,17 @@ namespace NzbDrone.Core.Test.Framework
|
|||
TestDbHelper.CreateDataBaseTemplate();
|
||||
}
|
||||
|
||||
protected StandardKernel LiveKernel = null;
|
||||
protected IDatabase Db = null;
|
||||
|
||||
|
||||
[SetUp]
|
||||
public virtual void CoreTestSetup()
|
||||
private IDatabase _db;
|
||||
protected IDatabase Db
|
||||
{
|
||||
LiveKernel = new StandardKernel();
|
||||
}
|
||||
|
||||
protected override void WithStrictMocker()
|
||||
{
|
||||
base.WithStrictMocker();
|
||||
|
||||
if (Db != null)
|
||||
get
|
||||
{
|
||||
Mocker.SetConstant(Db);
|
||||
if (_db == null)
|
||||
throw new InvalidOperationException("Test db doesn't exists. Make sure you call WithRealDb() if you intend to use an actual database.");
|
||||
|
||||
return _db;
|
||||
}
|
||||
private set { _db = value; }
|
||||
}
|
||||
|
||||
protected void WithRealDb()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue