mirror of
https://github.com/Radarr/Radarr.git
synced 2026-04-18 21:35:51 -04:00
JobProvider can reset itself.
cleaned up unit test logging
This commit is contained in:
@@ -18,6 +18,7 @@ namespace NzbDrone.Core.Test.Framework
|
||||
|
||||
public static IDatabase GetEmptyDatabase(bool enableLogging = false, string fileName = "")
|
||||
{
|
||||
Console.WriteLine("====================DataBase====================");
|
||||
Console.WriteLine("Cloning database from template.");
|
||||
|
||||
if (String.IsNullOrWhiteSpace(fileName))
|
||||
@@ -31,6 +32,10 @@ namespace NzbDrone.Core.Test.Framework
|
||||
|
||||
var database = Connection.GetPetaPocoDb(connectionString);
|
||||
|
||||
Console.WriteLine("====================DataBase====================");
|
||||
Console.WriteLine();
|
||||
Console.WriteLine();
|
||||
|
||||
return database;
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ using NUnit.Framework;
|
||||
using Ninject;
|
||||
using NzbDrone.Common;
|
||||
using NzbDrone.Test.Common;
|
||||
using PetaPoco;
|
||||
|
||||
namespace NzbDrone.Core.Test.Framework
|
||||
{
|
||||
@@ -30,6 +31,7 @@ namespace NzbDrone.Core.Test.Framework
|
||||
|
||||
protected StandardKernel LiveKernel = null;
|
||||
protected AutoMoqer Mocker = null;
|
||||
protected IDatabase Db = null;
|
||||
|
||||
protected string VirtualPath
|
||||
{
|
||||
@@ -60,6 +62,16 @@ namespace NzbDrone.Core.Test.Framework
|
||||
protected void WithStrictMocker()
|
||||
{
|
||||
Mocker = new AutoMoqer(MockBehavior.Strict);
|
||||
if (Db != null)
|
||||
{
|
||||
Mocker.SetConstant(Db);
|
||||
}
|
||||
}
|
||||
|
||||
protected void WithRealDb()
|
||||
{
|
||||
Db = MockLib.GetEmptyDatabase();
|
||||
Mocker.SetConstant(Db);
|
||||
}
|
||||
|
||||
[TearDown]
|
||||
@@ -67,6 +79,7 @@ namespace NzbDrone.Core.Test.Framework
|
||||
{
|
||||
ExceptionVerification.AssertNoUnexcpectedLogs();
|
||||
Mocker = new AutoMoqer(MockBehavior.Strict);
|
||||
WebTimer.Stop();
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user