mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-21 14:03:29 -07:00
NzbDrone Update no longer opens console/browser.
This commit is contained in:
parent
46c093559e
commit
34f3ee6b4b
18 changed files with 137 additions and 85 deletions
|
@ -16,22 +16,25 @@ namespace NzbDrone.App.Test
|
|||
[TestFixture]
|
||||
public class ContainerFixture : TestBase
|
||||
{
|
||||
|
||||
string[] args = new[]{"first","second"};
|
||||
|
||||
[Test]
|
||||
public void should_be_able_to_resolve_indexers()
|
||||
{
|
||||
MainAppContainerBuilder.BuildContainer().Resolve<IEnumerable<IIndexer>>().Should().NotBeEmpty();
|
||||
MainAppContainerBuilder.BuildContainer(args).Resolve<IEnumerable<IIndexer>>().Should().NotBeEmpty();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_be_able_to_resolve_downlodclients()
|
||||
{
|
||||
MainAppContainerBuilder.BuildContainer().Resolve<IEnumerable<IDownloadClient>>().Should().NotBeEmpty();
|
||||
MainAppContainerBuilder.BuildContainer(args).Resolve<IEnumerable<IDownloadClient>>().Should().NotBeEmpty();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void container_should_inject_itself()
|
||||
{
|
||||
var factory = MainAppContainerBuilder.BuildContainer().Resolve<IServiceFactory>();
|
||||
var factory = MainAppContainerBuilder.BuildContainer(args).Resolve<IServiceFactory>();
|
||||
|
||||
factory.Build<IIndexerService>().Should().NotBeNull();
|
||||
}
|
||||
|
@ -40,7 +43,7 @@ namespace NzbDrone.App.Test
|
|||
public void should_resolve_command_executor_by_name()
|
||||
{
|
||||
var genericExecutor = typeof(IExecute<>).MakeGenericType(typeof(RssSyncCommand));
|
||||
var container = MainAppContainerBuilder.BuildContainer();
|
||||
var container = MainAppContainerBuilder.BuildContainer(args);
|
||||
DbFactory.RegisterDatabase(container);
|
||||
|
||||
var executor = container.Resolve(genericExecutor);
|
||||
|
@ -53,7 +56,7 @@ namespace NzbDrone.App.Test
|
|||
[Ignore("need to fix this at some point")]
|
||||
public void should_return_same_instance_of_singletons()
|
||||
{
|
||||
var container = MainAppContainerBuilder.BuildContainer();
|
||||
var container = MainAppContainerBuilder.BuildContainer(args);
|
||||
|
||||
var first = container.ResolveAll<IHandle<ApplicationShutdownRequested>>().OfType<Scheduler>().Single();
|
||||
var second = container.ResolveAll<IHandle<ApplicationShutdownRequested>>().OfType<Scheduler>().Single();
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
using System.ServiceProcess;
|
||||
using FluentAssertions;
|
||||
using Moq;
|
||||
using NUnit.Framework;
|
||||
using NzbDrone.Common;
|
||||
|
@ -11,37 +10,6 @@ namespace NzbDrone.App.Test
|
|||
[TestFixture]
|
||||
public class RouterTest : TestBase<Router>
|
||||
{
|
||||
|
||||
[TestCase(null, ApplicationModes.Console)]
|
||||
[TestCase("", ApplicationModes.Console)]
|
||||
[TestCase("1", ApplicationModes.Help)]
|
||||
[TestCase("ii", ApplicationModes.Help)]
|
||||
[TestCase("uu", ApplicationModes.Help)]
|
||||
[TestCase("i", ApplicationModes.InstallService)]
|
||||
[TestCase("I", ApplicationModes.InstallService)]
|
||||
[TestCase("/I", ApplicationModes.InstallService)]
|
||||
[TestCase("/i", ApplicationModes.InstallService)]
|
||||
[TestCase("-I", ApplicationModes.InstallService)]
|
||||
[TestCase("-i", ApplicationModes.InstallService)]
|
||||
[TestCase("u", ApplicationModes.UninstallService)]
|
||||
[TestCase("U", ApplicationModes.UninstallService)]
|
||||
[TestCase("/U", ApplicationModes.UninstallService)]
|
||||
[TestCase("/u", ApplicationModes.UninstallService)]
|
||||
[TestCase("-U", ApplicationModes.UninstallService)]
|
||||
[TestCase("-u", ApplicationModes.UninstallService)]
|
||||
public void GetApplicationMode_single_arg(string arg, ApplicationModes modes)
|
||||
{
|
||||
Router.GetApplicationMode(new[] { arg }).Should().Be(modes);
|
||||
}
|
||||
|
||||
[TestCase("", "", ApplicationModes.Console)]
|
||||
[TestCase("", null, ApplicationModes.Console)]
|
||||
[TestCase("i", "n", ApplicationModes.Help)]
|
||||
public void GetApplicationMode_two_args(string a, string b, ApplicationModes modes)
|
||||
{
|
||||
Router.GetApplicationMode(new[] { a, b }).Should().Be(modes);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Route_should_call_install_service_when_application_mode_is_install()
|
||||
{
|
||||
|
@ -123,7 +91,7 @@ namespace NzbDrone.App.Test
|
|||
var serviceMock = Mocker.GetMock<IServiceProvider>();
|
||||
Mocker.GetMock<IRuntimeInfo>().SetupGet(c => c.IsUserInteractive).Returns(true);
|
||||
|
||||
consoleMock.Setup(c => c.PrintServiceDoestExist());
|
||||
consoleMock.Setup(c => c.PrintServiceDoesNotExist());
|
||||
serviceMock.Setup(c => c.ServiceExist(ServiceProvider.NZBDRONE_SERVICE_NAME)).Returns(false);
|
||||
|
||||
Subject.Route(ApplicationModes.UninstallService);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue