@@ -137,34 +137,23 @@ Describe "Format-Table DRT Unit Tests" -Tags "CI" {
137
137
$result | Should Match " Jim\s+5678\s+False"
138
138
}
139
139
140
- It " Format-Table with No Objects for End-To-End should work" {
141
- $p = @ {}
142
- $result = $p | Format-Table - Property " foo" , " bar" | Out-String
140
+ It " Format-Table with '<testName>' should return `$ null" - TestCases @ (
141
+ @ { testName = " empty array" ; testObject = @ {} },
142
+ @ { testName = " null" ; testObject = $null }
143
+ ) {
144
+ param ($testObject )
145
+ $result = $testObject | Format-Table - Property " foo" , " bar" | Out-String
143
146
$result | Should BeNullOrEmpty
144
147
}
145
148
146
- It " Format-Table with Null Objects for End-To-End should work" {
147
- $p = $null
148
- $result = $p | Format-Table - Property " foo" , " bar" | Out-String
149
- $result | Should BeNullOrEmpty
150
- }
151
-
152
- It " Format-Table with single line string for End-To-End should work" {
153
- $p = " single line string"
154
- $result = $p | Format-Table - Property " foo" , " bar" - Force | Out-String
155
- $result.Replace (" " , " " ).Replace([Environment ]::NewLine, " " ) | Should BeExactly " foobar------"
156
- }
157
-
158
- It " Format-Table with multiple line string for End-To-End should work" {
159
- $p = " Line1`n Line2"
160
- $result = $p | Format-Table - Property " foo" , " bar" - Force | Out-String
161
- $result.Replace (" " , " " ).Replace([Environment ]::NewLine, " " ) | Should BeExactly " foobar------"
162
- }
163
-
164
- It " Format-Table with string sequence for End-To-End should work" {
165
- $p = " Line1" , " Line2"
166
- $result = $p | Format-Table - Property " foo" , " bar" - Force | Out-String
167
- $result.Replace (" " , " " ).Replace([Environment ]::NewLine, " " ) | Should BeExactly " foobar------"
149
+ It " Format-Table with '<testName>' string and -Force should output table with requested properties" - TestCases @ (
150
+ @ { testName = " single line" ; testString = " single line string" },
151
+ @ { testName = " multi line" ; testString = " line1`n line2" },
152
+ @ { testName = " array" ; testString = " line1" , " line2" }
153
+ ) {
154
+ param ($testString )
155
+ $result = $testString | Format-Table - Property " foo" , " bar" - Force | Out-String
156
+ $result.Replace (" " , " " ).Replace([Environment ]::NewLine, " " ) | Should BeExactly " foobar------"
168
157
}
169
158
170
159
It " Format-Table with complex object for End-To-End should work" {
0 commit comments