Some minor clean-up.

This commit is contained in:
kay.one 2011-11-25 18:06:40 -08:00
parent 50a8af0842
commit 910efb5941
7 changed files with 18 additions and 21 deletions

View File

@ -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()
private IDatabase _db;
protected IDatabase Db
{
LiveKernel = new StandardKernel();
}
protected override void WithStrictMocker()
{
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()

View File

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

View File

@ -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;

View File

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

View File

@ -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;
}

View File

@ -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()

View File

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