refactor(sonarr): Rename lister class

The new name better reflects its actual responsibility, which is to do
more than just print info about release profiles.
pull/113/head
Robert Dailey 2 years ago
parent 227e4e82e5
commit e802c48e70

@ -46,7 +46,7 @@ public class SonarrCommandTest
[Test, AutoMockData]
public async Task List_terms_uses_specified_trash_id(
[Frozen] IReleaseProfileLister lister,
[Frozen] ISonarrGuideDataLister lister,
IConsole console,
ICompositionRoot compositionRoot,
SonarrCommand sut)
@ -63,7 +63,7 @@ public class SonarrCommandTest
[Test, AutoMockData]
public async Task List_release_profiles_is_invoked(
[Frozen] IReleaseProfileLister lister,
[Frozen] ISonarrGuideDataLister lister,
IConsole console,
ICompositionRoot compositionRoot,
SonarrCommand sut)

@ -32,7 +32,7 @@ public class SonarrCommand : ServiceCommand
{
await base.Process(container);
var lister = container.Resolve<IReleaseProfileLister>();
var lister = container.Resolve<ISonarrGuideDataLister>();
var profileUpdaterFactory = container.Resolve<Func<IReleaseProfileUpdater>>();
var qualityUpdaterFactory = container.Resolve<Func<ISonarrQualityDefinitionUpdater>>();
var configLoader = container.Resolve<IConfigurationLoader<SonarrConfiguration>>();

@ -12,13 +12,13 @@ namespace TrashLib.Tests.Sonarr;
[TestFixture]
[Parallelizable(ParallelScope.All)]
public class ReleaseProfileListerTest
public class SonarrGuideDataListerTest
{
[Test, AutoMockData]
public void Release_profiles_appear_in_console_output(
[Frozen] ISonarrGuideService guide,
[Frozen(Matching.ImplementedInterfaces)] FakeInMemoryConsole console,
ReleaseProfileLister sut)
SonarrGuideDataLister sut)
{
var testData = new[]
{
@ -38,7 +38,7 @@ public class ReleaseProfileListerTest
public void Terms_appear_in_console_output(
[Frozen] ISonarrGuideService guide,
[Frozen(Matching.ImplementedInterfaces)] FakeInMemoryConsole console,
ReleaseProfileLister sut)
SonarrGuideDataLister sut)
{
var requiredData = new[]
{
@ -85,7 +85,7 @@ public class ReleaseProfileListerTest
[Test, AutoMockData]
public void Release_profile_trash_id_is_used_to_look_up_data(
[Frozen] ISonarrGuideService guide,
ReleaseProfileLister sut)
SonarrGuideDataLister sut)
{
sut.ListTerms("098");
guide.Received().GetUnfilteredProfileById("098");

@ -1,6 +1,6 @@
namespace TrashLib.Services.Sonarr;
public interface IReleaseProfileLister
public interface ISonarrGuideDataLister
{
void ListReleaseProfiles();
void ListTerms(string releaseProfileId);

@ -16,7 +16,7 @@ public class SonarrAutofacModule : Module
builder.RegisterType<SonarrApi>().As<ISonarrApi>();
builder.RegisterType<SonarrValidationMessages>().As<ISonarrValidationMessages>();
builder.RegisterType<SonarrCompatibility>().As<ISonarrCompatibility>().SingleInstance();
builder.RegisterType<ReleaseProfileLister>().As<IReleaseProfileLister>();
builder.RegisterType<SonarrGuideDataLister>().As<ISonarrGuideDataLister>();
// Release Profile Support
builder.RegisterType<ReleaseProfileUpdater>().As<IReleaseProfileUpdater>();

@ -8,13 +8,13 @@ using TrashLib.Services.Sonarr.ReleaseProfile.Guide;
namespace TrashLib.Services.Sonarr;
[UsedImplicitly]
public class ReleaseProfileLister : IReleaseProfileLister
public class SonarrGuideDataLister : ISonarrGuideDataLister
{
private readonly IConsole _console;
private readonly ISonarrGuideService _guide;
private readonly ILogger _log;
public ReleaseProfileLister(IConsole console, ISonarrGuideService guide, ILogger log)
public SonarrGuideDataLister(IConsole console, ISonarrGuideService guide, ILogger log)
{
_console = console;
_guide = guide;
Loading…
Cancel
Save