Fixed broken tests

This commit is contained in:
kay.one 2011-11-07 23:01:52 -08:00
parent 390dfbdee8
commit b43397752e
5 changed files with 11 additions and 14 deletions

View File

@ -11,12 +11,6 @@ namespace NzbDrone.Common.Test
{ {
readonly EnviromentProvider enviromentController = new EnviromentProvider(); readonly EnviromentProvider enviromentController = new EnviromentProvider();
[Test]
public void Is_user_interactive_should_be_false()
{
enviromentController.IsUserInteractive.Should().BeTrue();
}
[Test] [Test]
public void StartupPath_should_not_be_empty() public void StartupPath_should_not_be_empty()
{ {

View File

@ -16,7 +16,7 @@ namespace NzbDrone.Core.Test
{ {
[TestFixture] [TestFixture]
// ReSharper disable InconsistentNaming // ReSharper disable InconsistentNaming
class CentralDispatchTest : TestBase class CentralDispatchFixture : TestBase
{ {
readonly IList<Type> indexers = typeof(CentralDispatch).Assembly.GetTypes().Where(t => t.IsSubclassOf(typeof(IndexerBase))).ToList(); readonly IList<Type> indexers = typeof(CentralDispatch).Assembly.GetTypes().Where(t => t.IsSubclassOf(typeof(IndexerBase))).ToList();
readonly IList<Type> jobs = typeof(CentralDispatch).Assembly.GetTypes().Where(t => t.GetInterfaces().Contains(typeof(IJob))).ToList(); readonly IList<Type> jobs = typeof(CentralDispatch).Assembly.GetTypes().Where(t => t.GetInterfaces().Contains(typeof(IJob))).ToList();

View File

@ -14,8 +14,6 @@ namespace NzbDrone.Core.Test.Framework
{ {
static TestBase() static TestBase()
{ {
InitLogging();
var oldDbFiles = Directory.GetFiles(Directory.GetCurrentDirectory(), "*.sdf", SearchOption.AllDirectories); var oldDbFiles = Directory.GetFiles(Directory.GetCurrentDirectory(), "*.sdf", SearchOption.AllDirectories);
foreach (var file in oldDbFiles) foreach (var file in oldDbFiles)
{ {
@ -47,6 +45,8 @@ namespace NzbDrone.Core.Test.Framework
[SetUp] [SetUp]
public virtual void SetupBase() public virtual void SetupBase()
{ {
InitLogging();
ExceptionVerification.Reset(); ExceptionVerification.Reset();
if (Directory.Exists(TempFolder)) if (Directory.Exists(TempFolder))
{ {

View File

@ -99,7 +99,7 @@
<Compile Include="JobTests\SeriesSearchJobTest.cs" /> <Compile Include="JobTests\SeriesSearchJobTest.cs" />
<Compile Include="ProviderTests\SearchProviderTest_Season.cs" /> <Compile Include="ProviderTests\SearchProviderTest_Season.cs" />
<Compile Include="ProviderTests\EventClientProviderTest.cs" /> <Compile Include="ProviderTests\EventClientProviderTest.cs" />
<Compile Include="CentralDispatchTest.cs" /> <Compile Include="CentralDispatchFixture.cs" />
<Compile Include="ProviderTests\XbmcProviderTest.cs" /> <Compile Include="ProviderTests\XbmcProviderTest.cs" />
<Compile Include="ProviderTests\DiskScanProviderTest.cs" /> <Compile Include="ProviderTests\DiskScanProviderTest.cs" />
<Compile Include="ProviderTests\EpisodeProviderTest_GetEpisodesByParseResult.cs" /> <Compile Include="ProviderTests\EpisodeProviderTest_GetEpisodesByParseResult.cs" />

View File

@ -1,6 +1,5 @@
using NLog; using NLog;
using NLog.Config; using NLog.Config;
using NUnit.Framework;
using NzbDrone.Common; using NzbDrone.Common;
namespace NzbDrone.Test.Common namespace NzbDrone.Test.Common
@ -9,10 +8,14 @@ namespace NzbDrone.Test.Common
{ {
protected static void InitLogging() protected static void InitLogging()
{ {
LogConfiguration.RegisterConsoleLogger(LogLevel.Trace); if (LogManager.Configuration == null || LogManager.Configuration is XmlLoggingConfiguration)
LogConfiguration.RegisterUdpLogger(); {
LogManager.Configuration = new LoggingConfiguration();
LogConfiguration.RegisterConsoleLogger(LogLevel.Trace);
LogConfiguration.RegisterUdpLogger();
RegisterExceptionVerification(); RegisterExceptionVerification();
}
} }
private static void RegisterExceptionVerification() private static void RegisterExceptionVerification()