@@ -73,6 +73,8 @@ public TestExplorerViewModel(ISelectionService selectionService,
73
73
ExpandAllCommand = new DelegateCommand ( LogManager . GetCurrentClassLogger ( ) , ExecuteExpandAll ) ;
74
74
IgnoreTestCommand = new DelegateCommand ( LogManager . GetCurrentClassLogger ( ) , ExecuteIgnoreTestCommand ) ;
75
75
UnignoreTestCommand = new DelegateCommand ( LogManager . GetCurrentClassLogger ( ) , ExecuteUnignoreTestCommand ) ;
76
+ IgnoreSelectedGroupCommand = new DelegateCommand ( LogManager . GetCurrentClassLogger ( ) , ExecuteIgnoreGroupCommand , CanIgnoreSelectedGroupCommand ) ;
77
+ UnignoreSelectedGroupCommand = new DelegateCommand ( LogManager . GetCurrentClassLogger ( ) , ExecuteUnignoreGroupCommand , CanUnignoreSelectedGroupCommand ) ;
76
78
77
79
RewritingManager = rewritingManager ;
78
80
AnnotationUpdater = annotationUpdater ;
@@ -275,6 +277,9 @@ private void HandleTestCompletion(object sender, TestCompletedEventArgs e)
275
277
public CommandBase IgnoreTestCommand { get ; }
276
278
public CommandBase UnignoreTestCommand { get ; }
277
279
280
+ public CommandBase IgnoreSelectedGroupCommand { get ; }
281
+ public CommandBase UnignoreSelectedGroupCommand { get ; }
282
+
278
283
#endregion
279
284
280
285
#region Delegates
@@ -294,6 +299,16 @@ private bool CanExecuteSelectedGroupCommand(object obj)
294
299
return ! Model . IsBusy && ( MouseOverTest != null || MouseOverGroup != null ) ;
295
300
}
296
301
302
+ private bool CanIgnoreSelectedGroupCommand ( object obj )
303
+ {
304
+ return CanExecuteSelectedGroupCommand ( obj ) ;
305
+ }
306
+
307
+ private bool CanUnignoreSelectedGroupCommand ( object obj )
308
+ {
309
+ return CanExecuteSelectedGroupCommand ( obj ) ;
310
+ }
311
+
297
312
private bool CanExecuteResetResultsCommand ( object obj )
298
313
{
299
314
return ! Model . IsBusy && Tests . OfType < TestMethodViewModel > ( ) . Any ( test => test . Result . Outcome != TestOutcome . Unknown ) ;
@@ -374,15 +389,24 @@ private void ExecuteIgnoreTestCommand(object parameter)
374
389
{
375
390
var rewriteSession = RewritingManager . CheckOutCodePaneSession ( ) ;
376
391
377
- AnnotationUpdater . AddAnnotation ( rewriteSession , _mousedOverTestMethod . Declaration , Parsing . Annotations . AnnotationType . IgnoreTest ) ;
392
+ var testMethod = parameter == null
393
+ ? _mousedOverTestMethod
394
+ : ( parameter as TestMethodViewModel ) . Method ;
395
+
396
+ AnnotationUpdater . AddAnnotation ( rewriteSession , testMethod . Declaration , Parsing . Annotations . AnnotationType . IgnoreTest ) ;
378
397
379
398
rewriteSession . TryRewrite ( ) ;
380
399
}
381
400
382
401
private void ExecuteUnignoreTestCommand ( object parameter )
383
402
{
384
403
var rewriteSession = RewritingManager . CheckOutCodePaneSession ( ) ;
385
- var ignoreTestAnnotations = _mousedOverTestMethod . Declaration . Annotations
404
+
405
+ var testMethod = parameter == null
406
+ ? _mousedOverTestMethod
407
+ : ( parameter as TestMethodViewModel ) . Method ;
408
+
409
+ var ignoreTestAnnotations = testMethod . Declaration . Annotations
386
410
. Where ( iannotations => iannotations . AnnotationType == Parsing . Annotations . AnnotationType . IgnoreTest ) ;
387
411
388
412
foreach ( var ignoreTestAnnotation in ignoreTestAnnotations )
@@ -393,6 +417,22 @@ private void ExecuteUnignoreTestCommand(object parameter)
393
417
rewriteSession . TryRewrite ( ) ;
394
418
}
395
419
420
+ private void ExecuteIgnoreGroupCommand ( object parameter )
421
+ {
422
+ foreach ( TestMethodViewModel test in _mouseOverGroup . Items )
423
+ {
424
+ ExecuteIgnoreTestCommand ( test ) ;
425
+ }
426
+ }
427
+
428
+ private void ExecuteUnignoreGroupCommand ( object parameter )
429
+ {
430
+ foreach ( TestMethodViewModel test in _mouseOverGroup . Items )
431
+ {
432
+ ExecuteUnignoreTestCommand ( test ) ;
433
+ }
434
+ }
435
+
396
436
private void ExecuteCopyResultsCommand ( object parameter )
397
437
{
398
438
const string XML_SPREADSHEET_DATA_FORMAT = "XML Spreadsheet" ;
0 commit comments