Removed assembly level fixtures

pull/6/head
kay.one 13 years ago
parent 72d0fc50ed
commit 207550176c

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

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

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

@ -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" />

@ -5,11 +5,12 @@ using Moq;
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)]

@ -4,11 +4,12 @@ using System.IO;
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;

@ -4,11 +4,12 @@ using System;
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();

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

@ -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" />

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

@ -3,11 +3,12 @@ using System.Diagnostics;
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;

@ -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 @@ namespace NzbDrone.Common.Test
}
[Test]
[Timeout(10000)]
//[Timeout(10000)]
public void Should_be_able_to_start_and_stop_service()
{
serviceProvider.GetService(ALWAYS_INSTALLED_SERVICE).Status

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

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

@ -116,16 +116,16 @@ namespace NzbDrone.Common
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 @@ namespace NzbDrone.Common
if (service.Status == ServiceControllerStatus.Running)
{
Logger.Info("{0} has started successfully.");
Logger.Info("{0} has started successfully.", serviceName);
}
else
{

@ -105,7 +105,7 @@ namespace NzbDrone.Core.Test
public void TearDownBase()
{
WebTimer.Stop();
}
}
}

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

@ -31,13 +31,18 @@ namespace NzbDrone.Core.Instrumentation
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();
}
}

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

@ -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" />

@ -5,12 +5,13 @@ using Moq;
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 @@ namespace NzbDrone.Update.Test
mocker.Resolve<UpdateProvider>().Start(TARGET_FOLDER);
ExceptionVerification.ExcpectedFatals(1);
mocker.VerifyAllMocks();
}

@ -6,12 +6,13 @@ using FluentAssertions;
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();

Loading…
Cancel
Save