style: code cleanup

recyclarr
Robert Dailey 3 years ago
parent 173011b320
commit d3943b5bdc

@ -11,10 +11,10 @@ namespace Trash.Tests.Sonarr.ReleaseProfile
public class FilteredProfileDataTest
{
[Test]
public void Filter_IncludeOptional_HasAllOptionalItems()
public void Filter_ExcludeOptional_HasNoOptionalItems()
{
var config = new ReleaseProfileConfig();
config.Filter.IncludeOptional = true;
config.Filter.IncludeOptional = false;
var profileData = new ProfileData
{
@ -40,21 +40,20 @@ namespace Trash.Tests.Sonarr.ReleaseProfile
filtered.Should().BeEquivalentTo(new
{
Ignored = new List<string> {"ignored1", "ignored2"},
Required = new List<string> {"required1", "required2"},
Ignored = new List<string> {"ignored1"},
Required = new List<string> {"required1"},
Preferred = new Dictionary<int, List<string>>
{
{100, new List<string> {"preferred1", "preferred3"}},
{200, new List<string> {"preferred2"}}
{100, new List<string> {"preferred1"}}
}
});
}
[Test]
public void Filter_ExcludeOptional_HasNoOptionalItems()
public void Filter_IncludeOptional_HasAllOptionalItems()
{
var config = new ReleaseProfileConfig();
config.Filter.IncludeOptional = false;
config.Filter.IncludeOptional = true;
var profileData = new ProfileData
{
@ -80,11 +79,12 @@ namespace Trash.Tests.Sonarr.ReleaseProfile
filtered.Should().BeEquivalentTo(new
{
Ignored = new List<string> {"ignored1"},
Required = new List<string> {"required1"},
Ignored = new List<string> {"ignored1", "ignored2"},
Required = new List<string> {"required1", "required2"},
Preferred = new Dictionary<int, List<string>>
{
{100, new List<string> {"preferred1"}}
{100, new List<string> {"preferred1", "preferred3"}},
{200, new List<string> {"preferred2"}}
}
});
}

@ -11,7 +11,7 @@ namespace Trash.Command
if (instance.GetType().IsAssignableTo<IServiceCommand>())
{
var activeServiceProvider = container.Resolve<IActiveServiceCommandProvider>();
activeServiceProvider.ActiveCommand = (IServiceCommand)instance;
activeServiceProvider.ActiveCommand = (IServiceCommand) instance;
}
return instance;

@ -31,19 +31,6 @@ namespace Trash.Command
protected ILogger Log { get; }
[CommandOption("preview", 'p', Description =
"Only display the processed markdown results without making any API calls.")]
public bool Preview { get; [UsedImplicitly] set; } = false;
[CommandOption("debug", 'd', Description =
"Display additional logs useful for development/debug purposes.")]
public bool Debug { get; [UsedImplicitly] set; } = false;
[CommandOption("config", 'c', Description =
"One or more YAML config files to use. All configs will be used and settings are additive. " +
"If not specified, the script will look for `trash.yml` in the same directory as the executable.")]
public List<string> Config { get; [UsedImplicitly] set; } = new() {DefaultConfigPath};
public async ValueTask ExecuteAsync(IConsole console)
{
SetupLogging();
@ -72,6 +59,19 @@ namespace Trash.Command
}
}
[CommandOption("preview", 'p', Description =
"Only display the processed markdown results without making any API calls.")]
public bool Preview { get; [UsedImplicitly] set; } = false;
[CommandOption("debug", 'd', Description =
"Display additional logs useful for development/debug purposes.")]
public bool Debug { get; [UsedImplicitly] set; } = false;
[CommandOption("config", 'c', Description =
"One or more YAML config files to use. All configs will be used and settings are additive. " +
"If not specified, the script will look for `trash.yml` in the same directory as the executable.")]
public List<string> Config { get; [UsedImplicitly] set; } = new() {DefaultConfigPath};
private void SetupLogging()
{
_loggingLevelSwitch.MinimumLevel =

Loading…
Cancel
Save