Some minor clean-up.

pull/3113/head
kay.one 13 years ago
parent 50a8af0842
commit 910efb5941

@ -1,4 +1,5 @@
using System.IO; using System;
using System.IO;
using NUnit.Framework; using NUnit.Framework;
using Ninject; using Ninject;
using NzbDrone.Common; using NzbDrone.Common;
@ -35,24 +36,17 @@ namespace NzbDrone.Core.Test.Framework
TestDbHelper.CreateDataBaseTemplate(); TestDbHelper.CreateDataBaseTemplate();
} }
protected StandardKernel LiveKernel = null; private IDatabase _db;
protected IDatabase Db = null; protected IDatabase Db
[SetUp]
public virtual void CoreTestSetup()
{
LiveKernel = new StandardKernel();
}
protected override void WithStrictMocker()
{ {
base.WithStrictMocker(); get
if (Db != null)
{ {
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() protected void WithRealDb()

@ -22,7 +22,7 @@ namespace NzbDrone.Core.Test.ProviderTests
[SetUp] [SetUp]
public void Setup() public void Setup()
{ {
tvDbProvider = LiveKernel.Get<TvDbProvider>(); tvDbProvider = new StandardKernel().Get<TvDbProvider>();
} }
[TestCase("The Simpsons")] [TestCase("The Simpsons")]

@ -2,6 +2,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics;
using System.Linq; using System.Linq;
using System.Linq.Expressions; using System.Linq.Expressions;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
@ -14,6 +15,7 @@ using NzbDrone.Test.Common.AutoMoq.Unity;
namespace NzbDrone.Test.Common.AutoMoq namespace NzbDrone.Test.Common.AutoMoq
{ {
[DebuggerStepThrough]
public class AutoMoqer public class AutoMoqer
{ {
internal readonly MockBehavior DefaultBehavior = MockBehavior.Default; internal readonly MockBehavior DefaultBehavior = MockBehavior.Default;

@ -144,7 +144,7 @@ hr
/* Footer */ /* Footer */
.footer #footer
{ {
padding: 1px 1px 1px 1px; padding: 1px 1px 1px 1px;
color: #065EFE; color: #065EFE;

@ -9,12 +9,10 @@ namespace NzbDrone.Web.Controllers
{ {
public class SharedController : Controller public class SharedController : Controller
{ {
private readonly JobProvider _jobProvider;
private readonly EnviromentProvider _enviromentProvider; private readonly EnviromentProvider _enviromentProvider;
public SharedController(JobProvider jobProvider, EnviromentProvider enviromentProvider) public SharedController(JobProvider jobProvider, EnviromentProvider enviromentProvider)
{ {
_jobProvider = jobProvider;
_enviromentProvider = enviromentProvider; _enviromentProvider = enviromentProvider;
} }

@ -7,13 +7,15 @@
#if DEBUG #if DEBUG
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using EnvDTE;
using EnvDTE80; using EnvDTE80;
using Process = EnvDTE.Process;
using Thread = System.Threading.Thread; using Thread = System.Threading.Thread;
namespace NzbDrone namespace NzbDrone
{ {
[DebuggerStepThrough]
public class ProcessAttacher public class ProcessAttacher
{ {
public static void Attach() public static void Attach()

@ -5,6 +5,7 @@ using NLog;
namespace NzbDrone.Providers namespace NzbDrone.Providers
{ {
[DebuggerStepThroughAttribute]
public class DebuggerProvider public class DebuggerProvider
{ {
private static readonly Logger Logger = LogManager.GetLogger("Host.DebuggerProvider"); private static readonly Logger Logger = LogManager.GetLogger("Host.DebuggerProvider");

Loading…
Cancel
Save