From d975b43f78e80c590d38d3dd1ef16dbf9b305829 Mon Sep 17 00:00:00 2001 From: Ilya Date: Sun, 27 May 2018 14:54:42 +0500 Subject: [PATCH 1/3] Fix xUnit test GetTempFileName Use Path.GetTempFileName() to get a temporary file. --- test/csharp/test_FileSystemProvider.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/csharp/test_FileSystemProvider.cs b/test/csharp/test_FileSystemProvider.cs index b01095bd715..e2952c6fd69 100644 --- a/test/csharp/test_FileSystemProvider.cs +++ b/test/csharp/test_FileSystemProvider.cs @@ -25,7 +25,7 @@ public class FileSystemProviderTests: IDisposable private string testContent; public FileSystemProviderTests() { - testPath = Path.Combine(Path.GetTempPath(),"test"); + testPath = Path.GetTempFileName(); testContent = "test content!"; if(File.Exists(testPath)) File.Delete(testPath); File.AppendAllText(testPath,testContent); From 8f3b19451863cee679eaff018b2afd0caead85a0 Mon Sep 17 00:00:00 2001 From: Ilya Date: Sun, 27 May 2018 15:27:25 +0500 Subject: [PATCH 2/3] Replace const with var --- test/csharp/test_FileSystemProvider.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/csharp/test_FileSystemProvider.cs b/test/csharp/test_FileSystemProvider.cs index e2952c6fd69..bf3e22bc58a 100644 --- a/test/csharp/test_FileSystemProvider.cs +++ b/test/csharp/test_FileSystemProvider.cs @@ -140,7 +140,7 @@ public void TestSetProperty() { if(property.Name == "Name") { - Assert.Equal("test", property.Value); + Assert.Equal(testPath, property.Value); } } } From 4dadb1b0066405e7b992e5834fb4e99f3aebc09e Mon Sep 17 00:00:00 2001 From: Ilya Date: Sun, 27 May 2018 16:13:45 +0500 Subject: [PATCH 3/3] Use FullName instead of Name --- test/csharp/test_FileSystemProvider.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/csharp/test_FileSystemProvider.cs b/test/csharp/test_FileSystemProvider.cs index bf3e22bc58a..48528e2b603 100644 --- a/test/csharp/test_FileSystemProvider.cs +++ b/test/csharp/test_FileSystemProvider.cs @@ -138,7 +138,7 @@ public void TestSetProperty() PSObject psobject1=PSObject.AsPSObject(fileSystemObject1); foreach(PSPropertyInfo property in psobject1.Properties) { - if(property.Name == "Name") + if(property.Name == "FullName") { Assert.Equal(testPath, property.Value); }