From 910efb5941e4ece1ee5886024420cd04a718714e Mon Sep 17 00:00:00 2001 From: "kay.one" Date: Fri, 25 Nov 2011 18:06:40 -0800 Subject: [PATCH] Some minor clean-up. --- NzbDrone.Core.Test/Framework/CoreTest.cs | 26 +++++++------------ .../ProviderTests/TvDbProviderTest.cs | 2 +- NzbDrone.Test.Common/AutoMoq/AutoMoqer.cs | 2 ++ NzbDrone.Web/Content/NzbDrone.css | 2 +- NzbDrone.Web/Controllers/SharedController.cs | 2 -- NzbDrone/ProcessAttacher.cs | 4 ++- NzbDrone/Providers/DebuggerProvider.cs | 1 + 7 files changed, 18 insertions(+), 21 deletions(-) diff --git a/NzbDrone.Core.Test/Framework/CoreTest.cs b/NzbDrone.Core.Test/Framework/CoreTest.cs index 8da45658b..004b5a927 100644 --- a/NzbDrone.Core.Test/Framework/CoreTest.cs +++ b/NzbDrone.Core.Test/Framework/CoreTest.cs @@ -1,4 +1,5 @@ -using System.IO; +using System; +using System.IO; using NUnit.Framework; using Ninject; using NzbDrone.Common; @@ -35,24 +36,17 @@ namespace NzbDrone.Core.Test.Framework TestDbHelper.CreateDataBaseTemplate(); } - protected StandardKernel LiveKernel = null; - protected IDatabase Db = null; - - - [SetUp] - public virtual void CoreTestSetup() - { - LiveKernel = new StandardKernel(); - } - - protected override void WithStrictMocker() + private IDatabase _db; + protected IDatabase Db { - base.WithStrictMocker(); - - if (Db != null) + get { - 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() diff --git a/NzbDrone.Core.Test/ProviderTests/TvDbProviderTest.cs b/NzbDrone.Core.Test/ProviderTests/TvDbProviderTest.cs index 6b5e7838d..106d28345 100644 --- a/NzbDrone.Core.Test/ProviderTests/TvDbProviderTest.cs +++ b/NzbDrone.Core.Test/ProviderTests/TvDbProviderTest.cs @@ -22,7 +22,7 @@ namespace NzbDrone.Core.Test.ProviderTests [SetUp] public void Setup() { - tvDbProvider = LiveKernel.Get(); + tvDbProvider = new StandardKernel().Get(); } [TestCase("The Simpsons")] diff --git a/NzbDrone.Test.Common/AutoMoq/AutoMoqer.cs b/NzbDrone.Test.Common/AutoMoq/AutoMoqer.cs index 552b150a6..b29339844 100644 --- a/NzbDrone.Test.Common/AutoMoq/AutoMoqer.cs +++ b/NzbDrone.Test.Common/AutoMoq/AutoMoqer.cs @@ -2,6 +2,7 @@ using System; using System.Collections.Generic; +using System.Diagnostics; using System.Linq; using System.Linq.Expressions; using System.Runtime.CompilerServices; @@ -14,6 +15,7 @@ using NzbDrone.Test.Common.AutoMoq.Unity; namespace NzbDrone.Test.Common.AutoMoq { + [DebuggerStepThrough] public class AutoMoqer { internal readonly MockBehavior DefaultBehavior = MockBehavior.Default; diff --git a/NzbDrone.Web/Content/NzbDrone.css b/NzbDrone.Web/Content/NzbDrone.css index 3021acee9..7da25824f 100644 --- a/NzbDrone.Web/Content/NzbDrone.css +++ b/NzbDrone.Web/Content/NzbDrone.css @@ -144,7 +144,7 @@ hr /* Footer */ -.footer +#footer { padding: 1px 1px 1px 1px; color: #065EFE; diff --git a/NzbDrone.Web/Controllers/SharedController.cs b/NzbDrone.Web/Controllers/SharedController.cs index 5b1688fe6..cedb4db46 100644 --- a/NzbDrone.Web/Controllers/SharedController.cs +++ b/NzbDrone.Web/Controllers/SharedController.cs @@ -9,12 +9,10 @@ namespace NzbDrone.Web.Controllers { public class SharedController : Controller { - private readonly JobProvider _jobProvider; private readonly EnviromentProvider _enviromentProvider; public SharedController(JobProvider jobProvider, EnviromentProvider enviromentProvider) { - _jobProvider = jobProvider; _enviromentProvider = enviromentProvider; } diff --git a/NzbDrone/ProcessAttacher.cs b/NzbDrone/ProcessAttacher.cs index edbe4af75..881462910 100644 --- a/NzbDrone/ProcessAttacher.cs +++ b/NzbDrone/ProcessAttacher.cs @@ -7,13 +7,15 @@ #if DEBUG using System; using System.Collections.Generic; +using System.Diagnostics; using System.Runtime.InteropServices; -using EnvDTE; using EnvDTE80; +using Process = EnvDTE.Process; using Thread = System.Threading.Thread; namespace NzbDrone { + [DebuggerStepThrough] public class ProcessAttacher { public static void Attach() diff --git a/NzbDrone/Providers/DebuggerProvider.cs b/NzbDrone/Providers/DebuggerProvider.cs index d37d25e85..e7fed0ca5 100644 --- a/NzbDrone/Providers/DebuggerProvider.cs +++ b/NzbDrone/Providers/DebuggerProvider.cs @@ -5,6 +5,7 @@ using NLog; namespace NzbDrone.Providers { + [DebuggerStepThroughAttribute] public class DebuggerProvider { private static readonly Logger Logger = LogManager.GetLogger("Host.DebuggerProvider");