mirror of
https://github.com/aphrody-labs/PowerShell.git
synced 2026-10-17 04:36:39 +00:00
Merge pull request #969 from PowerShell/ExportFormatDataCommandTests
Add Unit Test for Export-FormatData
This commit is contained in:
commit
2b335d8442
1 file changed
+16
@@ -1,3 +1,19 @@
|
|||||||
|
Describe "Export-FormatData DRT Unit Tests" -Tags DRT{
|
||||||
|
It "Test basic functionality" {
|
||||||
|
$fd = Get-FormatData
|
||||||
|
$tempFile = Join-Path $TestDrive -ChildPath "exportFormatTest.txt"
|
||||||
|
$results = Export-FormatData -InputObject $fd[0] -Path $tempFile
|
||||||
|
$content = Get-Content $tempFile
|
||||||
|
$formatViewDefinition = $fd[0].FormatViewDefinition
|
||||||
|
$typeName = $fd[0].TypeName
|
||||||
|
$content.Contains($typeName) | Should Be $true
|
||||||
|
for ($i = 0; $i -lt $formatViewDefinition.Count;$i++)
|
||||||
|
{
|
||||||
|
$content.Contains($formatViewDefinition[$i].Name) | Should Be $true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Describe "Export-FormatData" {
|
Describe "Export-FormatData" {
|
||||||
|
|
||||||
Context "Check Export-FormatData can be called validly." {
|
Context "Check Export-FormatData can be called validly." {
|
||||||
|
|||||||
Reference in new issue
Block a user