JobProvider can reset itself.

cleaned up unit test logging
This commit is contained in:
kay.one 2011-11-06 22:26:21 -08:00
commit 07458529f6
11 changed files with 401 additions and 398 deletions

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();
}