diff --git a/Snowflake.Data.Tests/UnitTests/Configuration/EasyLoggingConfigFinderTest.cs b/Snowflake.Data.Tests/UnitTests/Configuration/EasyLoggingConfigFinderTest.cs index 2b32b6bd5..1d0a1162a 100644 --- a/Snowflake.Data.Tests/UnitTests/Configuration/EasyLoggingConfigFinderTest.cs +++ b/Snowflake.Data.Tests/UnitTests/Configuration/EasyLoggingConfigFinderTest.cs @@ -120,7 +120,6 @@ public void TestThatTakesFilePathFromHomeDirectoryWhenNoOtherWaysPossible() } [Test] - [Ignore("TODO: modify the test and remove Ignore")] public void TestThatConfigFileIsNotUsedIfOthersCanModifyTheConfigFile() { if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) @@ -130,6 +129,8 @@ public void TestThatConfigFileIsNotUsedIfOthersCanModifyTheConfigFile() // arrange var configFilePath = CreateConfigTempFile(Config(EasyLoggingLogLevel.Warn.ToString(), InputConfigFilePath)); + var fileInfo = new Mono.Unix.UnixFileInfo(InputConfigFilePath); + fileInfo.Create(Mono.Unix.FileAccessPermissions.AllPermissions); // act var thrown = Assert.Throws(() => t_finder.FindConfigFilePath(configFilePath)); @@ -166,6 +167,20 @@ public void TestThatDoesNotFailWhenSearchForOneOfDirectoriesFails() t_environmentOperations.Verify(e => e.GetFolderPath(Environment.SpecialFolder.UserProfile), Times.Once); } + [Test] + public void TestThatDoesNotFailWhenHomeDirectoryReturnsNull() + { + // arrange + MockHomeDirectoryReturnsNull(); + + // act + var filePath = t_finder.FindConfigFilePath(null); + + // assert + Assert.IsNull(filePath); + t_environmentOperations.Verify(e => e.GetFolderPath(Environment.SpecialFolder.UserProfile), Times.Once); + } + [Test] public void TestThatDoesNotFailWhenHomeDirectoryDoesNotExist() {