From 4275336a8acba7bc071d755d0c7fe96c9d20e943 Mon Sep 17 00:00:00 2001 From: Robert Dailey Date: Sun, 15 Jan 2023 10:49:01 -0600 Subject: [PATCH] refactor: Fix unused member variable inspection issue --- ...vironmentVariableNotDefinedExceptionTest.cs | 18 ++++++++++++++++++ .../EnvironmentVariableNotDefinedException.cs | 7 +++---- 2 files changed, 21 insertions(+), 4 deletions(-) create mode 100644 src/Recyclarr.TrashLib.Tests/Config/EnvironmentVariables/EnvironmentVariableNotDefinedExceptionTest.cs diff --git a/src/Recyclarr.TrashLib.Tests/Config/EnvironmentVariables/EnvironmentVariableNotDefinedExceptionTest.cs b/src/Recyclarr.TrashLib.Tests/Config/EnvironmentVariables/EnvironmentVariableNotDefinedExceptionTest.cs new file mode 100644 index 00000000..bd08f569 --- /dev/null +++ b/src/Recyclarr.TrashLib.Tests/Config/EnvironmentVariables/EnvironmentVariableNotDefinedExceptionTest.cs @@ -0,0 +1,18 @@ +using FluentAssertions; +using NUnit.Framework; +using Recyclarr.TrashLib.Config.EnvironmentVariables; + +namespace Recyclarr.TrashLib.Tests.Config.EnvironmentVariables; + +[TestFixture] +[Parallelizable(ParallelScope.All)] +public class EnvironmentVariableNotDefinedExceptionTest +{ + [Test] + public void Properties_get_initialized() + { + var sut = new EnvironmentVariableNotDefinedException(15, "key"); + sut.Line.Should().Be(15); + sut.EnvironmentVariableName.Should().Be("key"); + } +} diff --git a/src/Recyclarr.TrashLib/Config/EnvironmentVariables/EnvironmentVariableNotDefinedException.cs b/src/Recyclarr.TrashLib/Config/EnvironmentVariables/EnvironmentVariableNotDefinedException.cs index 08014dc5..5e789421 100644 --- a/src/Recyclarr.TrashLib/Config/EnvironmentVariables/EnvironmentVariableNotDefinedException.cs +++ b/src/Recyclarr.TrashLib/Config/EnvironmentVariables/EnvironmentVariableNotDefinedException.cs @@ -5,11 +5,10 @@ public class EnvironmentVariableNotDefinedException : Exception public int Line { get; } public string EnvironmentVariableName { get; } - public EnvironmentVariableNotDefinedException(int line, string environmentVariableName) - : base( - $"Line {line} refers to undefined environment variable {environmentVariableName} and no default is specified.") + public EnvironmentVariableNotDefinedException(int line, string envVarName) + : base($"Line {line} refers to undefined environment variable {envVarName} and no default is specified.") { Line = line; - EnvironmentVariableName = environmentVariableName; + EnvironmentVariableName = envVarName; } }