@@ -154,6 +154,36 @@ suite('Code Lens Tests', function() {
154
154
assert . ok ( failedDetail ! . duration !== undefined , 'Should have execution time' ) ;
155
155
} ) ;
156
156
157
+ test ( "Can run parameterized with name tests" , async function ( ) {
158
+ const document : TextDocument = await workspace . openTextDocument ( Uris . JUNIT4_PARAMETERIZED_WITH_NAME_TEST ) ;
159
+ await window . showTextDocument ( document ) ;
160
+
161
+ const codeLensProvider : TestCodeLensProvider = new TestCodeLensProvider ( ) ;
162
+ const codeLens : CodeLens [ ] = await codeLensProvider . provideCodeLenses ( document , Token . cancellationToken ) ;
163
+ assert . equal ( codeLens . length , 4 , 'Code Lens should appear for @Test annotation' ) ;
164
+
165
+ const command : Command | undefined = codeLens [ 0 ] . command ;
166
+ assert . notEqual ( command , undefined , 'Command inside Code Lens should not be undefined' ) ;
167
+ assert . notEqual ( command , null , 'Command inside Code Lens should not be null' ) ;
168
+
169
+ const testItem : ITestItem [ ] = command ! . arguments as ITestItem [ ] ;
170
+ assert . notEqual ( testItem , undefined , 'Test Item inside Code Lens Command should not be undefined' ) ;
171
+ assert . notEqual ( testItem , null , 'Test Item inside Code Lens Command should not be null' ) ;
172
+ assert . equal ( testItem . length , 1 , 'Test Item inside Code Lens Command should has one element' ) ;
173
+
174
+ await commands . executeCommand ( command ! . command , testItem [ 0 ] ) ;
175
+
176
+ const projectName : string = testItem [ 0 ] . project ;
177
+ const passedDetail : ITestResult | undefined = testResultManager . getResultById ( `${ projectName } @junit4.ParameterizedWithNameTest#test[0: expect=1]` ) ;
178
+ assert . equal ( passedDetail ! . status , TestStatus . Pass , 'Should have passed case' ) ;
179
+ assert . ok ( passedDetail ! . duration !== undefined , 'Should have execution time' ) ;
180
+
181
+ const failedDetail : ITestResult | undefined = testResultManager . getResultById ( `${ projectName } @junit4.ParameterizedWithNameTest#test[3: expect=()]` ) ;
182
+ assert . equal ( failedDetail ! . status , TestStatus . Fail , 'Should have failed case' ) ;
183
+ assert . ok ( failedDetail ! . duration !== undefined , 'Should have execution time' ) ;
184
+
185
+ } ) ;
186
+
157
187
test ( "Assume failure should mark as skipped" , async function ( ) {
158
188
const document : TextDocument = await workspace . openTextDocument ( Uris . JUNIT4_ASSUME_TEST ) ;
159
189
await window . showTextDocument ( document ) ;
0 commit comments