1
0
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:
kay.one
2011-11-06 22:26:21 -08:00
parent 82b6ec5ed4
commit 07458529f6
11 changed files with 401 additions and 398 deletions
+5
View File
@@ -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;
}
+13
View File
@@ -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();
}