From 95626faeb1cc5f358d3e7db1c7c1d83b3629c198 Mon Sep 17 00:00:00 2001 From: Jeff Bienstadt Date: Tue, 25 Jul 2017 10:31:07 -0700 Subject: [PATCH 1/3] Increase code coverage of Get-ChildItem on file system. --- .../Microsoft.PowerShell.Management/FileSystem.Tests.ps1 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/FileSystem.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/FileSystem.Tests.ps1 index 94516097e65..8bcbecdee7d 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/FileSystem.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/FileSystem.Tests.ps1 @@ -84,6 +84,11 @@ Describe "Basic FileSystem Provider Tests" -Tags "CI" { $dirContents.Count | Should Be 2 } + It "Verity Get-ChildItem can get the name of a specified item." { + $fileName = Get-ChildItem $testFile -Name + $fileName | Should BeExactly $fileName + } + It "Set-Content to a file" { $content = Set-Content -Value $testContent -Path $testFile -PassThru $content | Should BeExactly $testContent From ff4a24b699c7a2315659243192bac8beef8b0e92 Mon Sep 17 00:00:00 2001 From: Jeff Bienstadt Date: Tue, 25 Jul 2017 16:35:05 -0700 Subject: [PATCH 2/3] Changes per code review. --- .../Microsoft.PowerShell.Management/FileSystem.Tests.ps1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/FileSystem.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/FileSystem.Tests.ps1 index 8bcbecdee7d..b9f999dfe4e 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/FileSystem.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/FileSystem.Tests.ps1 @@ -86,7 +86,8 @@ Describe "Basic FileSystem Provider Tests" -Tags "CI" { It "Verity Get-ChildItem can get the name of a specified item." { $fileName = Get-ChildItem $testFile -Name - $fileName | Should BeExactly $fileName + $fileInfo = Get-ChildItem $testFile + $fileName | Should BeExactly $fileInfo.Name } It "Set-Content to a file" { From dd6791752a329ad5db460bb58d80ebb682308348 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Tue, 1 Aug 2017 09:56:41 -0700 Subject: [PATCH 3/3] Fixed typo --- .../Microsoft.PowerShell.Management/FileSystem.Tests.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/FileSystem.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/FileSystem.Tests.ps1 index b9f999dfe4e..35616108f49 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/FileSystem.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/FileSystem.Tests.ps1 @@ -84,7 +84,7 @@ Describe "Basic FileSystem Provider Tests" -Tags "CI" { $dirContents.Count | Should Be 2 } - It "Verity Get-ChildItem can get the name of a specified item." { + It "Verify Get-ChildItem can get the name of a specified item." { $fileName = Get-ChildItem $testFile -Name $fileInfo = Get-ChildItem $testFile $fileName | Should BeExactly $fileInfo.Name