refactor: Address analysis issues

pull/153/head
Robert Dailey 2 years ago
parent 7e2a6290dc
commit fc0daf631b

@ -1,4 +1,5 @@
using System.Data.HashFunction.FNV; using System.Data.HashFunction.FNV;
using System.Globalization;
using System.IO.Abstractions; using System.IO.Abstractions;
using System.Text; using System.Text;
using Recyclarr.TrashLib.Cache; using Recyclarr.TrashLib.Cache;
@ -33,7 +34,7 @@ public class CacheStoragePath : ICacheStoragePath
public IFileInfo CalculatePath(string cacheObjectName) public IFileInfo CalculatePath(string cacheObjectName)
{ {
return _paths.CacheDirectory return _paths.CacheDirectory
.SubDirectory(_serviceCommand.Name.ToLower()) .SubDirectory(_serviceCommand.Name.ToLower(CultureInfo.CurrentCulture))
.SubDirectory(_config.Name ?? BuildServiceGuid()) .SubDirectory(_config.Name ?? BuildServiceGuid())
.File(cacheObjectName + ".json"); .File(cacheObjectName + ".json");
} }

@ -8,7 +8,7 @@ namespace Recyclarr.Common.Tests.Extensions;
[Parallelizable(ParallelScope.All)] [Parallelizable(ParallelScope.All)]
public class DictionaryExtensionsTest public class DictionaryExtensionsTest
{ {
private class MySampleValue private sealed class MySampleValue
{ {
} }

@ -15,7 +15,7 @@ public static class Verify
return ArgumentMatcher.Enqueue(new AssertionMatcher<T>(action)); return ArgumentMatcher.Enqueue(new AssertionMatcher<T>(action));
} }
private class AssertionMatcher<T> : IArgumentMatcher<T> private sealed class AssertionMatcher<T> : IArgumentMatcher<T>
{ {
private readonly Action<T> _assertion; private readonly Action<T> _assertion;

@ -14,20 +14,20 @@ namespace Recyclarr.TrashLib.Tests.Cache;
[Parallelizable(ParallelScope.All)] [Parallelizable(ParallelScope.All)]
public class ServiceCacheTest public class ServiceCacheTest
{ {
private class ObjectWithoutAttribute private sealed class ObjectWithoutAttribute
{ {
} }
private const string ValidObjectName = "azAZ_09"; private const string ValidObjectName = "azAZ_09";
[CacheObjectName(ValidObjectName)] [CacheObjectName(ValidObjectName)]
private class ObjectWithAttribute private sealed class ObjectWithAttribute
{ {
public string TestValue { get; init; } = ""; public string TestValue { get; init; } = "";
} }
[CacheObjectName("invalid+name")] [CacheObjectName("invalid+name")]
private class ObjectWithAttributeInvalidChars private sealed class ObjectWithAttributeInvalidChars
{ {
} }

@ -16,7 +16,7 @@ namespace Recyclarr.TrashLib.Tests.CustomFormat;
[Parallelizable(ParallelScope.All)] [Parallelizable(ParallelScope.All)]
public class CachePersisterTest public class CachePersisterTest
{ {
private class Context private sealed class Context
{ {
public Context() public Context()
{ {

@ -19,14 +19,14 @@ namespace Recyclarr.TrashLib.Tests.CustomFormat.Processors;
[Parallelizable(ParallelScope.All)] [Parallelizable(ParallelScope.All)]
public class GuideProcessorTest public class GuideProcessorTest
{ {
private class TestGuideProcessorSteps : IGuideProcessorSteps private sealed class TestGuideProcessorSteps : IGuideProcessorSteps
{ {
public ICustomFormatStep CustomFormat { get; } = new CustomFormatStep(); public ICustomFormatStep CustomFormat { get; } = new CustomFormatStep();
public IConfigStep Config { get; } = new ConfigStep(); public IConfigStep Config { get; } = new ConfigStep();
public IQualityProfileStep QualityProfile { get; } = new QualityProfileStep(); public IQualityProfileStep QualityProfile { get; } = new QualityProfileStep();
} }
private class Context private sealed class Context
{ {
public Context() public Context()
{ {

@ -15,7 +15,7 @@ namespace Recyclarr.TrashLib.Tests.CustomFormat.Processors.GuideSteps;
[Parallelizable(ParallelScope.All)] [Parallelizable(ParallelScope.All)]
public class CustomFormatStepTest public class CustomFormatStepTest
{ {
private class Context private sealed class Context
{ {
public List<CustomFormatData> TestGuideData { get; } = new() public List<CustomFormatData> TestGuideData { get; } = new()
{ {

@ -25,7 +25,7 @@ namespace Recyclarr.TrashLib.Tests.Sonarr;
[Parallelizable(ParallelScope.All)] [Parallelizable(ParallelScope.All)]
public class SonarrCompatibilityTest public class SonarrCompatibilityTest
{ {
private class TestContext : IDisposable private sealed class TestContext : IDisposable
{ {
private readonly JsonSerializerSettings _jsonSettings; private readonly JsonSerializerSettings _jsonSettings;

Loading…
Cancel
Save