|
1 | 1 | namespace Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel.Implementation |
2 | 2 | { |
3 | | -#if !NETCOREAPP |
| 3 | +#if !NETCOREAPP1_1 |
4 | 4 | using System; |
5 | 5 | using System.Collections.Generic; |
6 | 6 | using System.IO; |
@@ -108,9 +108,12 @@ public void ReturnsEnumerableOfObjectsRepresentingExistingFiles() |
108 | 108 | } |
109 | 109 |
|
110 | 110 | [TestMethod] |
| 111 | + [TestCategory("WindowsOnly")] |
111 | 112 | public void ThrowsUnauthorizedAccessExceptionWhenProcessDoesNotHaveRightToListDirectory() |
112 | 113 | { |
113 | 114 | Trace.WriteLine(string.Format("{0} Blocking Listing Permission on: {1} ",DateTime.Now.ToLongTimeString(), this.storageFolder.FullName)); |
| 115 | + // Only on Windows as the APIs are not available in Linux. |
| 116 | + // The product also does not this this. |
114 | 117 | using (new DirectoryAccessDenier(this.storageFolder, FileSystemRights.ListDirectory)) |
115 | 118 | { |
116 | 119 | var folder = new PlatformFolder(this.storageFolder); |
@@ -176,10 +179,13 @@ public void ThrowsIOExceptionWhenDesiredFileNameIsTooLong() |
176 | 179 | AssertEx.Throws<PathTooLongException>(() => folder.CreateFile(new string('F', 1024))); |
177 | 180 | } |
178 | 181 |
|
179 | | - [TestMethod] |
| 182 | + [TestMethod] |
| 183 | + [TestCategory("WindowsOnly")] |
180 | 184 | public void ThrowsUnauthorizedAccessExceptionWhenProcessDoesNotHaveRightToCreateFile() |
181 | 185 | { |
182 | 186 | Trace.WriteLine(string.Format("{0} Blocking Listing Permission on: {1} ", DateTime.Now.ToLongTimeString(), this.storageFolder.FullName)); |
| 187 | + // Only on Windows as the APIs are not available in Linux. |
| 188 | + // The product also does not this this. |
183 | 189 | using (new DirectoryAccessDenier(this.storageFolder, FileSystemRights.CreateFiles)) |
184 | 190 | { |
185 | 191 | var folder = new PlatformFolder(this.storageFolder); |
|
0 commit comments