From e802c48e701d5c2bf3d7796507b088cc8ab35358 Mon Sep 17 00:00:00 2001 From: Robert Dailey Date: Thu, 25 Aug 2022 07:30:56 -0500 Subject: [PATCH] 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. --- src/Recyclarr.Tests/Command/SonarrCommandTest.cs | 4 ++-- src/Recyclarr/Command/SonarrCommand.cs | 2 +- ...eProfileListerTest.cs => SonarrGuideDataListerTest.cs} | 8 ++++---- ...IReleaseProfileLister.cs => ISonarrGuideDataLister.cs} | 2 +- src/TrashLib/Services/Sonarr/SonarrAutofacModule.cs | 2 +- .../{ReleaseProfileLister.cs => SonarrGuideDataLister.cs} | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-) rename src/TrashLib.Tests/Sonarr/{ReleaseProfileListerTest.cs => SonarrGuideDataListerTest.cs} (95%) rename src/TrashLib/Services/Sonarr/{IReleaseProfileLister.cs => ISonarrGuideDataLister.cs} (74%) rename src/TrashLib/Services/Sonarr/{ReleaseProfileLister.cs => SonarrGuideDataLister.cs} (94%) diff --git a/src/Recyclarr.Tests/Command/SonarrCommandTest.cs b/src/Recyclarr.Tests/Command/SonarrCommandTest.cs index 9bf6610c..e2d86456 100644 --- a/src/Recyclarr.Tests/Command/SonarrCommandTest.cs +++ b/src/Recyclarr.Tests/Command/SonarrCommandTest.cs @@ -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) diff --git a/src/Recyclarr/Command/SonarrCommand.cs b/src/Recyclarr/Command/SonarrCommand.cs index 72947282..d45da57a 100644 --- a/src/Recyclarr/Command/SonarrCommand.cs +++ b/src/Recyclarr/Command/SonarrCommand.cs @@ -32,7 +32,7 @@ public class SonarrCommand : ServiceCommand { await base.Process(container); - var lister = container.Resolve(); + var lister = container.Resolve(); var profileUpdaterFactory = container.Resolve>(); var qualityUpdaterFactory = container.Resolve>(); var configLoader = container.Resolve>(); diff --git a/src/TrashLib.Tests/Sonarr/ReleaseProfileListerTest.cs b/src/TrashLib.Tests/Sonarr/SonarrGuideDataListerTest.cs similarity index 95% rename from src/TrashLib.Tests/Sonarr/ReleaseProfileListerTest.cs rename to src/TrashLib.Tests/Sonarr/SonarrGuideDataListerTest.cs index 9996997c..f8ebe801 100644 --- a/src/TrashLib.Tests/Sonarr/ReleaseProfileListerTest.cs +++ b/src/TrashLib.Tests/Sonarr/SonarrGuideDataListerTest.cs @@ -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"); diff --git a/src/TrashLib/Services/Sonarr/IReleaseProfileLister.cs b/src/TrashLib/Services/Sonarr/ISonarrGuideDataLister.cs similarity index 74% rename from src/TrashLib/Services/Sonarr/IReleaseProfileLister.cs rename to src/TrashLib/Services/Sonarr/ISonarrGuideDataLister.cs index 5cf7599c..60018a70 100644 --- a/src/TrashLib/Services/Sonarr/IReleaseProfileLister.cs +++ b/src/TrashLib/Services/Sonarr/ISonarrGuideDataLister.cs @@ -1,6 +1,6 @@ namespace TrashLib.Services.Sonarr; -public interface IReleaseProfileLister +public interface ISonarrGuideDataLister { void ListReleaseProfiles(); void ListTerms(string releaseProfileId); diff --git a/src/TrashLib/Services/Sonarr/SonarrAutofacModule.cs b/src/TrashLib/Services/Sonarr/SonarrAutofacModule.cs index ce9a9753..9fc18aab 100644 --- a/src/TrashLib/Services/Sonarr/SonarrAutofacModule.cs +++ b/src/TrashLib/Services/Sonarr/SonarrAutofacModule.cs @@ -16,7 +16,7 @@ public class SonarrAutofacModule : Module builder.RegisterType().As(); builder.RegisterType().As(); builder.RegisterType().As().SingleInstance(); - builder.RegisterType().As(); + builder.RegisterType().As(); // Release Profile Support builder.RegisterType().As(); diff --git a/src/TrashLib/Services/Sonarr/ReleaseProfileLister.cs b/src/TrashLib/Services/Sonarr/SonarrGuideDataLister.cs similarity index 94% rename from src/TrashLib/Services/Sonarr/ReleaseProfileLister.cs rename to src/TrashLib/Services/Sonarr/SonarrGuideDataLister.cs index ec544ae4..e83ef215 100644 --- a/src/TrashLib/Services/Sonarr/ReleaseProfileLister.cs +++ b/src/TrashLib/Services/Sonarr/SonarrGuideDataLister.cs @@ -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;