mirror of
https://github.com/Radarr/Radarr.git
synced 2024-11-04 10:02:40 +01:00
Fixed some more tests
This commit is contained in:
parent
c03f4b8125
commit
42c17e885c
@ -84,6 +84,7 @@
|
||||
<Compile Include="ProcessProviderTests.cs" />
|
||||
<Compile Include="ReflectionExtensions.cs" />
|
||||
<Compile Include="ReflectionTests\ReflectionExtensionFixture.cs" />
|
||||
<Compile Include="ServiceFactoryFixture.cs" />
|
||||
<Compile Include="ServiceProviderTests.cs" />
|
||||
<Compile Include="WebClientTests.cs" />
|
||||
</ItemGroup>
|
||||
|
@ -1,14 +1,13 @@
|
||||
using System.Linq;
|
||||
using FluentAssertions;
|
||||
using NUnit.Framework;
|
||||
using NzbDrone.Common;
|
||||
using NzbDrone.Common.EnvironmentInfo;
|
||||
using NzbDrone.Core.Lifecycle;
|
||||
using NzbDrone.Core.Messaging.Events;
|
||||
using NzbDrone.Host;
|
||||
using NzbDrone.Test.Common;
|
||||
|
||||
namespace NzbDrone.Mono.Test
|
||||
namespace NzbDrone.Common.Test
|
||||
{
|
||||
[TestFixture]
|
||||
public class ServiceFactoryFixture : TestBase<ServiceFactory>
|
||||
@ -16,9 +15,10 @@ public class ServiceFactoryFixture : TestBase<ServiceFactory>
|
||||
[Test]
|
||||
public void event_handlers_should_be_unique()
|
||||
{
|
||||
MonoOnly();
|
||||
var container = MainAppContainerBuilder.BuildContainer(new StartupContext());
|
||||
container.Resolve<IAppFolderFactory>().Register();
|
||||
|
||||
Mocker.SetConstant(MainAppContainerBuilder.BuildContainer(new StartupContext()));
|
||||
Mocker.SetConstant(container);
|
||||
|
||||
var handlers = Subject.BuildAll<IHandle<ApplicationShutdownRequested>>()
|
||||
.Select(c => c.GetType().FullName);
|
@ -4,7 +4,6 @@
|
||||
using NLog.Common;
|
||||
using NLog.Config;
|
||||
using NLog;
|
||||
using NLog.Layouts;
|
||||
using NLog.Targets;
|
||||
using NzbDrone.Common.Instrumentation;
|
||||
using NzbDrone.Core.Datastore;
|
||||
@ -78,12 +77,10 @@ protected override void Write(LogEventInfo logEvent)
|
||||
log.Message += ": " + logEvent.Exception.Message;
|
||||
}
|
||||
|
||||
|
||||
log.Exception = logEvent.Exception.ToString();
|
||||
log.ExceptionType = logEvent.Exception.GetType().ToString();
|
||||
}
|
||||
|
||||
|
||||
log.Level = logEvent.Level.Name;
|
||||
|
||||
var sqlCommand = new SQLiteCommand(INSERT_COMMAND, _connection);
|
||||
|
@ -74,7 +74,6 @@
|
||||
<Compile Include="DiskProviderTests\DiskProviderFixture.cs" />
|
||||
<Compile Include="DiskProviderTests\FreeSpaceFixture.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="ServiceFactoryFixture.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="app.config" />
|
||||
|
@ -55,6 +55,9 @@ public override void InheritFolderPermissions(string filename)
|
||||
catch (NotImplementedException)
|
||||
{
|
||||
}
|
||||
catch (PlatformNotSupportedException)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public override void SetPermissions(string path, string mask, string user, string group)
|
||||
|
@ -71,7 +71,6 @@
|
||||
<Compile Include="DiskProviderTests\DiskProviderFixture.cs" />
|
||||
<Compile Include="DiskProviderTests\FreeSpaceFixture.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="ServiceFactoryFixture.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\NzbDrone.Common\NzbDrone.Common.csproj">
|
||||
|
@ -1,31 +0,0 @@
|
||||
using System.Linq;
|
||||
using FluentAssertions;
|
||||
using NUnit.Framework;
|
||||
using NzbDrone.Common;
|
||||
using NzbDrone.Common.EnvironmentInfo;
|
||||
using NzbDrone.Core.Lifecycle;
|
||||
using NzbDrone.Core.Messaging.Events;
|
||||
using NzbDrone.Host;
|
||||
using NzbDrone.Test.Common;
|
||||
|
||||
namespace NzbDrone.Windows.Test
|
||||
{
|
||||
[TestFixture]
|
||||
public class ServiceFactoryFixture : TestBase<ServiceFactory>
|
||||
{
|
||||
[SetUp]
|
||||
public void setup()
|
||||
{
|
||||
Mocker.SetConstant(MainAppContainerBuilder.BuildContainer(new StartupContext()));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void event_handlers_should_be_unique()
|
||||
{
|
||||
var handlers = Subject.BuildAll<IHandle<ApplicationShutdownRequested>>()
|
||||
.Select(c => c.GetType().FullName);
|
||||
|
||||
handlers.Should().OnlyHaveUniqueItems();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user