Skip to content

Export-Csv Test Improvements #5139

@markekraus

Description

@markekraus

While looking at the current tests Export-Csv I found the following issues:


{ $testObject | Export-Csv -ErrorAction SilentlyContinue } | Should Throw

Should use ShouldBeErrorId and test for a proper FQEID



Should be Should Be and a full srting instead of partial match since this is static.


{ $testObject | Export-Csv -Path $testCsv } | Should Not Throw

Should be epcsv here to test the alias.


$filePath = Join-Path $TestDrive -ChildPath "test.csv"
$newLine = [environment]::NewLine

should be wrapped in a BeforeAll{}



This can be removed because the $TestDrive will clean up after itself.

Metadata

Metadata

Assignees

Labels

HacktoberfestPotential candidate to participate in HacktoberfestResolution-FixedThe issue is fixed.WG-Quality-Testissues in a test or in test infrastructure

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions