Skip to content

Commit

Permalink
Remove unused variable
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-ext-simba-lf committed Jan 31, 2024
1 parent 17e9efe commit 065941f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ public class EasyLoggingConfigFinderTest
[ThreadStatic]
private static Mock<UnixOperations> t_unixOperations;

[ThreadStatic]
private static Mock<DirectoryOperations> t_directoryOperations;

[ThreadStatic]
private static Mock<EnvironmentOperations> t_environmentOperations;

Expand All @@ -43,10 +40,8 @@ public void Setup()
{
t_fileOperations = new Mock<FileOperations>();
t_unixOperations = new Mock<UnixOperations>();
t_directoryOperations = new Mock<DirectoryOperations>();
t_environmentOperations = new Mock<EnvironmentOperations>();
t_finder = new EasyLoggingConfigFinder(t_fileOperations.Object, t_unixOperations.Object, t_directoryOperations.Object, t_environmentOperations.Object);
MockDirectoriesExist();
t_finder = new EasyLoggingConfigFinder(t_fileOperations.Object, t_unixOperations.Object, t_environmentOperations.Object);
MockHomeDirectory();
}

Expand Down Expand Up @@ -186,7 +181,6 @@ public void TestThatDoesNotFailWhenHomeDirectoryDoesNotExist()
{
// arrange
MockFileOnHomePath();
MockHomeDirectoryDoesNotExist();
MockFileOnHomePathDoesNotExist();

// act
Expand All @@ -197,14 +191,6 @@ public void TestThatDoesNotFailWhenHomeDirectoryDoesNotExist()
t_environmentOperations.Verify(e => e.GetFolderPath(Environment.SpecialFolder.UserProfile), Times.Once);
}

private static void MockDirectoriesExist()
{
t_directoryOperations
.Setup(d => d.Exists(
It.Is<string>(dir => dir.Equals(DriverDirectory) || dir.Equals(HomeDirectory))))
.Returns(true);
}

private static void MockHasFlagReturnsTrue()
{
t_unixOperations
Expand All @@ -227,13 +213,6 @@ private static void MockHomeDirectoryFails()
.Throws(() => new Exception("No home directory"));
}

private static void MockHomeDirectoryDoesNotExist()
{
t_directoryOperations
.Setup(d => d.Exists(HomeDirectory))
.Returns(false);
}

private static void MockFileOnHomePathDoesNotExist()
{
t_fileOperations
Expand Down
5 changes: 2 additions & 3 deletions Snowflake.Data/Configuration/EasyLoggingConfigFinder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,12 @@ internal class EasyLoggingConfigFinder
private readonly UnixOperations _unixOperations;
private readonly EnvironmentOperations _environmentOperations;

public static readonly EasyLoggingConfigFinder Instance = new EasyLoggingConfigFinder(FileOperations.Instance, UnixOperations.Instance, DirectoryOperations.Instance, EnvironmentOperations.Instance);
public static readonly EasyLoggingConfigFinder Instance = new EasyLoggingConfigFinder(FileOperations.Instance, UnixOperations.Instance, EnvironmentOperations.Instance);

internal EasyLoggingConfigFinder(FileOperations fileOperations, UnixOperations unixFileOperations, DirectoryOperations directoryOperations, EnvironmentOperations environmentOperations)
internal EasyLoggingConfigFinder(FileOperations fileOperations, UnixOperations unixFileOperations, EnvironmentOperations environmentOperations)
{
_fileOperations = fileOperations;
_unixOperations = unixFileOperations;
_directoryOperations = directoryOperations;
_environmentOperations = environmentOperations;
}

Expand Down

0 comments on commit 065941f

Please sign in to comment.