Scheduled Tasks should work as long as they are registered.

This commit is contained in:
kay.one 2013-05-08 23:38:20 -07:00
commit 32431540c5
21 changed files with 253 additions and 106 deletions

View file

@ -1,13 +1,14 @@
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using NUnit.Framework;
using NzbDrone.Common;
using NzbDrone.Common.Messaging;
using NzbDrone.Core.Download;
using NzbDrone.Core.Indexers;
using NzbDrone.Core.Jobs;
using NzbDrone.Core.Lifecycle;
using NzbDrone.Test.Common;
using FluentAssertions;
using TinyIoC;
using System.Linq;
namespace NzbDrone.App.Test
{
@ -17,9 +18,12 @@ namespace NzbDrone.App.Test
[Test]
public void should_be_able_to_resolve_event_handlers()
{
MainAppContainerBuilder.BuildContainer().Resolve<IEnumerable<IProcessMessage>>().Should().NotBeEmpty();
MainAppContainerBuilder.BuildContainer().ResolveAll<IEnumerable<IProcessMessage>>().Should().NotBeEmpty();
}
[Test]
public void should_be_able_to_resolve_indexers()
{
@ -50,5 +54,17 @@ namespace NzbDrone.App.Test
executor.Should().NotBeNull();
executor.Should().BeAssignableTo<IExecute<RssSyncCommand>>();
}
[Test]
[Ignore("need to fix this at some point")]
public void should_return_same_instance_of_singletons()
{
var container = MainAppContainerBuilder.BuildContainer();
var first = container.ResolveAll<IHandle<ApplicationShutdownRequested>>().OfType<Scheduler>().Single();
var second = container.ResolveAll<IHandle<ApplicationShutdownRequested>>().OfType<Scheduler>().Single();
first.Should().BeSameAs(second);
}
}
}