1212namespace Snowflake . Data . Tests . UnitTests . Tools
1313{
1414 [ TestFixture , NonParallelizable ]
15- public class FileOperationsTest
15+ [ Platform ( Exclude = "Win" ) ]
16+ public class FileOperationsUnixTest
1617 {
1718 private static FileOperations s_fileOperations ;
1819 private static readonly string s_relativeWorkingDirectory = $ "file_operations_test_{ Path . GetRandomFileName ( ) } ";
@@ -38,20 +39,6 @@ public static void After()
3839 }
3940
4041 [ Test ]
41- [ Platform ( "Win" ) ]
42- public void TestReadAllTextOnWindows ( )
43- {
44- var filePath = CreateConfigTempFile ( s_workingDirectory , s_content ) ;
45-
46- // act
47- var result = s_fileOperations . ReadAllText ( filePath , TomlConnectionBuilder . ValidateFilePermissions ) ;
48-
49- // assert
50- Assert . AreEqual ( s_content , result ) ;
51- }
52-
53- [ Test ]
54- [ Platform ( Exclude = "Win" ) ]
5542 public void TestReadAllTextCheckingPermissionsUsingTomlConfigurationFileValidations (
5643 [ ValueSource ( nameof ( UserAllowedFilePermissions ) ) ]
5744 FileAccessPermissions userAllowedFilePermissions )
@@ -69,7 +56,6 @@ public void TestReadAllTextCheckingPermissionsUsingTomlConfigurationFileValidati
6956 }
7057
7158 [ Test ]
72- [ Platform ( Exclude = "Win" ) ]
7359 public void TestShouldThrowExceptionIfOtherPermissionsIsSetWhenReadConfigurationFile (
7460 [ ValueSource ( nameof ( UserAllowedFilePermissions ) ) ]
7561 FileAccessPermissions userAllowedFilePermissions )
@@ -86,7 +72,6 @@ public void TestShouldThrowExceptionIfOtherPermissionsIsSetWhenReadConfiguration
8672
8773
8874 [ Test ]
89- [ Platform ( Exclude = "Win" ) ]
9075 public void TestFileIsSafeOnNotWindows ( )
9176 {
9277 // arrange
@@ -98,7 +83,6 @@ public void TestFileIsSafeOnNotWindows()
9883 }
9984
10085 [ Test ]
101- [ Platform ( Exclude = "Win" ) ]
10286 public void TestFileIsNotSafeOnNotWindowsWhenTooBroadPermissionsAreUsed (
10387 [ ValueSource ( nameof ( InsecurePermissions ) ) ]
10488 FileAccessPermissions permissions )
@@ -112,19 +96,6 @@ public void TestFileIsNotSafeOnNotWindowsWhenTooBroadPermissionsAreUsed(
11296 }
11397
11498 [ Test ]
115- [ Platform ( "Win" ) ]
116- public void TestFileIsSafeOnWindows ( )
117- {
118- // arrange
119- var absoluteFilePath = Path . Combine ( s_workingDirectory , s_fileName ) ;
120- File . Create ( absoluteFilePath ) . Close ( ) ;
121-
122- // act and assert
123- Assert . IsTrue ( s_fileOperations . IsFileSafe ( absoluteFilePath ) ) ;
124- }
125-
126- [ Test ]
127- [ Platform ( Exclude = "Win" ) ]
12899 public void TestOwnerIsCurrentUser ( )
129100 {
130101 // arrange
@@ -137,7 +108,6 @@ public void TestOwnerIsCurrentUser()
137108 }
138109
139110 [ Test ]
140- [ Platform ( Exclude = "Win" ) ]
141111 public void TestOwnerIsNotCurrentUser ( )
142112 {
143113 // arrange
@@ -150,7 +120,6 @@ public void TestOwnerIsNotCurrentUser()
150120 }
151121
152122 [ Test ]
153- [ Platform ( Exclude = "Win" ) ]
154123 public void TestFileIsNotSecureWhenNotOwnedByCurrentUser ( )
155124 {
156125 // arrange
@@ -171,7 +140,6 @@ public void TestFileIsNotSecureWhenNotOwnedByCurrentUser()
171140 }
172141
173142 [ Test ]
174- [ Platform ( Exclude = "Win" ) ]
175143 public void TestFileCopyUsesProperPermissions ( )
176144 {
177145 // arrange
@@ -193,7 +161,6 @@ public void TestFileCopyUsesProperPermissions()
193161 }
194162
195163 [ Test ]
196- [ Platform ( Exclude = "Win" ) ]
197164 public void TestFileCopyShouldThrowExecptionIfTooBroadPermissionsAreUsed ( )
198165 {
199166 // arrange
@@ -232,3 +199,4 @@ public static IEnumerable<FileAccessPermissions> InsecurePermissions()
232199 }
233200 }
234201}
202+
0 commit comments