1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-05 02:22:31 +01:00

Removed assembly level fixtures

This commit is contained in:
kay.one 2011-11-13 10:16:31 -08:00
parent 72d0fc50ed
commit 207550176c
22 changed files with 43 additions and 51 deletions

View File

@ -1,11 +1,12 @@
using FluentAssertions;
using NUnit.Framework;
using Ninject;
using NzbDrone.Test.Common;
namespace NzbDrone.App.Test
{
[TestFixture]
public class CentralDispatchTests
public class CentralDispatchTests : TestBase
{
[Test]
public void Kernel_can_get_kernel()

View File

@ -1,8 +0,0 @@
// ReSharper disable CheckNamespace
using NUnit.Framework;
using NzbDrone.Test.Common;
[SetUpFixture]
public class Fixtures : LoggingTest
{
}

View File

@ -1,22 +1,18 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics;
using System.Linq;
using System.Text;
using AutoMoq;
using FizzWare.NBuilder;
using FluentAssertions;
using Moq;
using NUnit.Framework;
using NzbDrone.Common;
using NzbDrone.Common.Model;
using NzbDrone.Model;
using NzbDrone.Providers;
using NzbDrone.Test.Common;
namespace NzbDrone.App.Test
{
[TestFixture]
public class MonitoringProviderTest
public class MonitoringProviderTest : TestBase
{
[Test]

View File

@ -65,7 +65,6 @@
</ItemGroup>
<ItemGroup>
<Compile Include="CentralDispatchTests.cs" />
<Compile Include="Fixtures.cs" />
<Compile Include="RouterTest.cs" />
<Compile Include="MonitoringProviderTest.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />

View File

@ -5,11 +5,12 @@
using NUnit.Framework;
using NzbDrone.Common;
using NzbDrone.Model;
using NzbDrone.Test.Common;
namespace NzbDrone.App.Test
{
[TestFixture]
public class RouterTest
public class RouterTest : TestBase
{
[TestCase(null, ApplicationMode.Console)]

View File

@ -4,11 +4,12 @@
using System.Linq;
using FluentAssertions;
using NUnit.Framework;
using NzbDrone.Test.Common;
namespace NzbDrone.Common.Test
{
[TestFixture]
public class DiskProviderTests
public class DiskProviderTests : TestBase
{
DirectoryInfo BinFolder;
DirectoryInfo BinFolderCopy;

View File

@ -4,11 +4,12 @@
using System.IO;
using FluentAssertions;
using NUnit.Framework;
using NzbDrone.Test.Common;
namespace NzbDrone.Common.Test
{
[TestFixture]
public class EnviromentProviderTest
public class EnviromentProviderTest : TestBase
{
readonly EnviromentProvider enviromentProvider = new EnviromentProvider();

View File

@ -1,8 +0,0 @@
// ReSharper disable CheckNamespace
using NUnit.Framework;
using NzbDrone.Test.Common;
[SetUpFixture]
public class Fixtures : LoggingTest
{
}

View File

@ -65,7 +65,6 @@
<Compile Include="PathExtentionFixture.cs" />
<Compile Include="DiskProviderTests.cs" />
<Compile Include="EnviromentProviderTest.cs" />
<Compile Include="Fixtures.cs" />
<Compile Include="ProcessProviderTests.cs" />
<Compile Include="ServiceControllerTests.cs" />
<Compile Include="WebClientTests.cs" />

View File

@ -2,11 +2,12 @@
using Moq;
using NUnit.Framework;
using NzbDrone.Common;
using NzbDrone.Test.Common;
namespace NzbDrone.App.Test
{
[TestFixture]
public class PathExtentionFixture
public class PathExtentionFixture : TestBase
{
private EnviromentProvider GetEnviromentProvider()

View File

@ -3,11 +3,12 @@
using System.Linq;
using FluentAssertions;
using NUnit.Framework;
using NzbDrone.Test.Common;
namespace NzbDrone.Common.Test
{
[TestFixture]
public class ProcessProviderTests
public class ProcessProviderTests : TestBase
{
private const string DummyProccessName = "NzbDrone.Test.Dummy";
ProcessProvider _processProvider;

View File

@ -3,11 +3,12 @@
using System.ServiceProcess;
using FluentAssertions;
using NUnit.Framework;
using NzbDrone.Test.Common;
namespace NzbDrone.Common.Test
{
[TestFixture]
public class ServiceControllerTests
public class ServiceControllerTests:TestBase
{
private const string ALWAYS_INSTALLED_SERVICE = "SCardSvr"; //Smart Card
private const string TEMP_SERVICE_NAME = "NzbDrone_Nunit"; //Smart Card
@ -74,7 +75,7 @@ public void UnInstallService()
}
[Test]
[Timeout(10000)]
//[Timeout(10000)]
public void Should_be_able_to_start_and_stop_service()
{
serviceProvider.GetService(ALWAYS_INSTALLED_SERVICE).Status

View File

@ -1,11 +1,12 @@
// ReSharper disable InconsistentNaming
using FluentAssertions;
using NUnit.Framework;
using NzbDrone.Test.Common;
namespace NzbDrone.Common.Test
{
[TestFixture]
public class WebClientTests
public class WebClientTests : TestBase
{
[Test]
public void DownloadString_should_be_able_to_download_jquery()

View File

@ -86,8 +86,12 @@ public static void RegisterExceptioneer()
public static void Reload()
{
var sw = Stopwatch.StartNew();
LogManager.Configuration.Reload();
LogManager.ReconfigExistingLoggers();
sw.Stop();
Console.WriteLine("Reload: " + sw.Elapsed.TotalSeconds);
}
}
}

View File

@ -116,16 +116,16 @@ public virtual void Stop(string serviceName)
public virtual void Start(string serviceName)
{
Logger.Info("Starting {0} Service...");
Logger.Info("Starting {0} Service...", serviceName);
var service = GetService(serviceName);
if (service == null)
{
Logger.Warn("Unable to start '{0}' no service with that name exists.", serviceName);
}
if (service.Status != ServiceControllerStatus.Paused || service.Status != ServiceControllerStatus.Stopped)
if (service.Status != ServiceControllerStatus.Paused && service.Status != ServiceControllerStatus.Stopped)
{
Logger.Warn("Service is in a state that can't be started {0}", service.Status);
Logger.Warn("Service is in a state that can't be started. Current status: {0}", service.Status);
}
service.Start();
@ -135,7 +135,7 @@ public virtual void Start(string serviceName)
if (service.Status == ServiceControllerStatus.Running)
{
Logger.Info("{0} has started successfully.");
Logger.Info("{0} has started successfully.", serviceName);
}
else
{

View File

@ -105,7 +105,7 @@ public void JobProvider_should_be_singletone()
public void TearDownBase()
{
WebTimer.Stop();
}
}
}

View File

@ -39,6 +39,7 @@ private void InitializeApp()
MigrationsHelper.Run(mainConnectionString, true);
LogConfiguration.RegisterDatabaseLogger(Kernel.Get<DatabaseTarget>());
LogConfiguration.Reload();
Kernel.Get<QualityProvider>().SetupDefaultProfiles();
Kernel.Get<QualityTypeProvider>().SetupDefault();

View File

@ -31,13 +31,18 @@ public void Setup()
Common.LogConfiguration.RegisterConsoleLogger(LogLevel.Info, "NzbDrone.Core.CentralDispatch");
LogManager.ConfigurationReloaded += ((s, e) => RegisterDatabaseLogger(_databaseTarget));
Common.LogConfiguration.Reload();
}
public static void RegisterDatabaseLogger(DatabaseTarget databaseTarget)
{
LogManager.Configuration.AddTarget("DbLogger", databaseTarget);
LogManager.Configuration.LoggingRules.Add(new LoggingRule("*", LogLevel.Debug, databaseTarget));
Reload();
}
public static void Reload()
{
Common.LogConfiguration.Reload();
}
}

View File

@ -1,8 +0,0 @@
// ReSharper disable CheckNamespace
using NUnit.Framework;
using NzbDrone.Test.Common;
[SetUpFixture]
public class Fixtures : LoggingTest
{
}

View File

@ -48,6 +48,7 @@
<Reference Include="Moq">
<HintPath>..\packages\Moq.4.0.10827\lib\NET40\Moq.dll</HintPath>
</Reference>
<Reference Include="NLog, Version=2.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL" />
<Reference Include="nunit.framework">
<HintPath>..\packages\NUnit.2.5.10.11092\lib\nunit.framework.dll</HintPath>
</Reference>
@ -66,7 +67,6 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Fixtures.cs" />
<Compile Include="UpdateProviderVerifyTest.cs" />
<Compile Include="UpdateProviderStartTest.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />

View File

@ -5,12 +5,13 @@
using NUnit.Framework;
using NzbDrone.Common;
using NzbDrone.Common.Model;
using NzbDrone.Test.Common;
using NzbDrone.Update.Providers;
namespace NzbDrone.Update.Test
{
[TestFixture]
class UpdateProviderStartTest
class UpdateProviderStartTest : TestBase
{
AutoMoqer mocker = new AutoMoqer();
@ -109,6 +110,8 @@ public void should_restore_if_update_fails()
mocker.Resolve<UpdateProvider>().Start(TARGET_FOLDER);
ExceptionVerification.ExcpectedFatals(1);
mocker.VerifyAllMocks();
}

View File

@ -6,12 +6,13 @@
using Moq;
using NUnit.Framework;
using NzbDrone.Common;
using NzbDrone.Test.Common;
using NzbDrone.Update.Providers;
namespace NzbDrone.Update.Test
{
[TestFixture]
class UpdateProviderVerifyTest
class UpdateProviderVerifyTest : TestBase
{
AutoMoqer mocker = new AutoMoqer();