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 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()
get
{
base.WithStrictMocker();
if (_db == null)
throw new InvalidOperationException("Test db doesn't exists. Make sure you call WithRealDb() if you intend to use an actual database.");
if (Db != null)
{
Mocker.SetConstant(Db);
return _db;
}
private set { _db = value; }
}
protected void WithRealDb()

@ -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")]

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

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

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

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

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

Loading…
Cancel
Save