Fix xUnit test GetTempFileName (#6943)
Use Path.GetTempFileName() to get a temporary file.
This commit is contained in:
parent
c297eac50e
commit
a5f77955e8
|
@ -25,7 +25,7 @@ namespace PSTests.Parallel
|
|||
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);
|
||||
|
@ -138,9 +138,9 @@ namespace PSTests.Parallel
|
|||
PSObject psobject1=PSObject.AsPSObject(fileSystemObject1);
|
||||
foreach(PSPropertyInfo property in psobject1.Properties)
|
||||
{
|
||||
if(property.Name == "Name")
|
||||
if(property.Name == "FullName")
|
||||
{
|
||||
Assert.Equal("test", property.Value);
|
||||
Assert.Equal(testPath, property.Value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue