1
0
Fork 0
mirror of https://github.com/Radarr/Radarr synced 2024-12-27 10:19:41 +00:00

Fixed some more tests

This commit is contained in:
Mark McDowall 2014-10-17 22:47:00 -07:00
parent c03f4b8125
commit 42c17e885c
7 changed files with 9 additions and 41 deletions

View file

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

View file

@ -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();
Mocker.SetConstant(MainAppContainerBuilder.BuildContainer(new StartupContext()));
var container = MainAppContainerBuilder.BuildContainer(new StartupContext());
container.Resolve<IAppFolderFactory>().Register();
Mocker.SetConstant(container);
var handlers = Subject.BuildAll<IHandle<ApplicationShutdownRequested>>()
.Select(c => c.GetType().FullName);

View file

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

View file

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

View file

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

View file

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

View file

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