Fixed some more tests

pull/2/head
Mark McDowall 10 years ago
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 @@ namespace NzbDrone.Mono.Test
[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);

@ -4,7 +4,6 @@ using System.Data.SQLite;
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 @@ namespace NzbDrone.Core.Instrumentation
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 @@ namespace NzbDrone.Mono
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…
Cancel
Save