mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-16 10:03:51 -07:00
Alot of refactoring.
This commit is contained in:
parent
2e94e322f4
commit
72d0fc50ed
89 changed files with 503 additions and 767 deletions
53
NzbDrone.Core.Test/Framework/CoreTest.cs
Normal file
53
NzbDrone.Core.Test/Framework/CoreTest.cs
Normal file
|
@ -0,0 +1,53 @@
|
|||
using System.IO;
|
||||
using NUnit.Framework;
|
||||
using Ninject;
|
||||
using NzbDrone.Test.Common;
|
||||
using PetaPoco;
|
||||
|
||||
namespace NzbDrone.Core.Test.Framework
|
||||
{
|
||||
public class CoreTest : TestBase
|
||||
// ReSharper disable InconsistentNaming
|
||||
{
|
||||
static CoreTest()
|
||||
{
|
||||
var oldDbFiles = Directory.GetFiles(Directory.GetCurrentDirectory(), "*.sdf", SearchOption.AllDirectories);
|
||||
foreach (var file in oldDbFiles)
|
||||
{
|
||||
try
|
||||
{
|
||||
File.Delete(file);
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
MockLib.CreateDataBaseTemplate();
|
||||
}
|
||||
|
||||
protected StandardKernel LiveKernel = null;
|
||||
protected IDatabase Db = null;
|
||||
|
||||
|
||||
[SetUp]
|
||||
public virtual void SetupBase()
|
||||
{
|
||||
LiveKernel = new StandardKernel();
|
||||
}
|
||||
|
||||
protected override void WithStrictMocker()
|
||||
{
|
||||
base.WithStrictMocker();
|
||||
|
||||
if (Db != null)
|
||||
{
|
||||
Mocker.SetConstant(Db);
|
||||
}
|
||||
}
|
||||
|
||||
protected void WithRealDb()
|
||||
{
|
||||
Db = MockLib.GetEmptyDatabase();
|
||||
Mocker.SetConstant(Db);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue