diff --git a/Snowflake.Data.Tests/UnitTests/Configuration/EasyLoggingConfigFinderTest.cs b/Snowflake.Data.Tests/UnitTests/Configuration/EasyLoggingConfigFinderTest.cs index 7d1de4930..bea1e14d0 100644 --- a/Snowflake.Data.Tests/UnitTests/Configuration/EasyLoggingConfigFinderTest.cs +++ b/Snowflake.Data.Tests/UnitTests/Configuration/EasyLoggingConfigFinderTest.cs @@ -29,9 +29,6 @@ public class EasyLoggingConfigFinderTest [ThreadStatic] private static Mock t_unixOperations; - [ThreadStatic] - private static Mock t_directoryOperations; - [ThreadStatic] private static Mock t_environmentOperations; @@ -43,10 +40,8 @@ public void Setup() { t_fileOperations = new Mock(); t_unixOperations = new Mock(); - t_directoryOperations = new Mock(); t_environmentOperations = new Mock(); - 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(); } @@ -186,7 +181,6 @@ public void TestThatDoesNotFailWhenHomeDirectoryDoesNotExist() { // arrange MockFileOnHomePath(); - MockHomeDirectoryDoesNotExist(); MockFileOnHomePathDoesNotExist(); // act @@ -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(dir => dir.Equals(DriverDirectory) || dir.Equals(HomeDirectory)))) - .Returns(true); - } - private static void MockHasFlagReturnsTrue() { t_unixOperations @@ -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 diff --git a/Snowflake.Data/Configuration/EasyLoggingConfigFinder.cs b/Snowflake.Data/Configuration/EasyLoggingConfigFinder.cs index 3a541e955..3fed8850e 100644 --- a/Snowflake.Data/Configuration/EasyLoggingConfigFinder.cs +++ b/Snowflake.Data/Configuration/EasyLoggingConfigFinder.cs @@ -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; }