@@ -211,6 +211,7 @@ public void Should_Add_Replaceable_RunConfiguration_If_Not_Present()
211
211
<DataCollectors>
212
212
<DataCollector friendlyName='Code Coverage' enabled='true'>
213
213
<Configuration>
214
+ <CodeCoverage/>
214
215
<Format>Cobertura</Format>
215
216
</Configuration>
216
217
</DataCollector>
@@ -236,6 +237,7 @@ public void Should_Add_Replaceable_RunConfiguration_If_Not_Present()
236
237
<DataCollectors>
237
238
<DataCollector friendlyName='Code Coverage' enabled='true'>
238
239
<Configuration>
240
+ <CodeCoverage/>
239
241
<Format>Cobertura</Format>
240
242
<FCCGenerated/>
241
243
</Configuration>
@@ -259,6 +261,7 @@ public void Should_Add_Replaceable_ResultsDirectory_And_TestAdaptersPath_If_Not_
259
261
<DataCollectors>
260
262
<DataCollector friendlyName='Code Coverage' enabled='true'>
261
263
<Configuration>
264
+ <CodeCoverage/>
262
265
<Format>Cobertura</Format>
263
266
</Configuration>
264
267
</DataCollector>
@@ -283,6 +286,7 @@ public void Should_Add_Replaceable_ResultsDirectory_And_TestAdaptersPath_If_Not_
283
286
<DataCollectors>
284
287
<DataCollector friendlyName='Code Coverage' enabled='true'>
285
288
<Configuration>
289
+ <CodeCoverage/>
286
290
<Format>Cobertura</Format>
287
291
<FCCGenerated/>
288
292
</Configuration>
@@ -424,6 +428,7 @@ public void Should_AddEnabledReplacementAttributeIfNotPresent_To_Existing_Ms_Dat
424
428
<DataCollectors>
425
429
<DataCollector friendlyName='Code Coverage'>
426
430
<Configuration>
431
+ <CodeCoverage/>
427
432
<Format>Cobertura</Format>
428
433
<FCCGenerated/>
429
434
</Configuration>
@@ -444,6 +449,7 @@ public void Should_AddEnabledReplacementAttributeIfNotPresent_To_Existing_Ms_Dat
444
449
<DataCollectors>
445
450
<DataCollector friendlyName='Code Coverage' enabled='{ replacements . Enabled } '>
446
451
<Configuration>
452
+ <CodeCoverage/>
447
453
<Format>Cobertura</Format>
448
454
<FCCGenerated/>
449
455
</Configuration>
@@ -465,6 +471,7 @@ public void Should_Add_Cobertura_Format_To_Existing_Configuration_Element_If_Not
465
471
<DataCollectors>
466
472
<DataCollector friendlyName='Code Coverage' enabled='true'>
467
473
<Configuration>
474
+ <CodeCoverage/>
468
475
<FCCGenerated/>
469
476
</Configuration>
470
477
</DataCollector>
@@ -483,8 +490,9 @@ public void Should_Add_Cobertura_Format_To_Existing_Configuration_Element_If_Not
483
490
<DataCollectors>
484
491
<DataCollector friendlyName='Code Coverage' enabled='true'>
485
492
<Configuration>
486
- <Format>Cobertura</Format >
493
+ <CodeCoverage/ >
487
494
<FCCGenerated/>
495
+ <Format>Cobertura</Format>
488
496
</Configuration>
489
497
</DataCollector>
490
498
</DataCollectors>
@@ -504,6 +512,7 @@ public void Should_Correct_Existing_Format_To_Cobertura_When_Different_Format()
504
512
<DataCollectors>
505
513
<DataCollector friendlyName='Code Coverage' enabled='true'>
506
514
<Configuration>
515
+ <CodeCoverage/>
507
516
<Format>Xml</Format>
508
517
<FCCGenerated/>
509
518
</Configuration>
@@ -523,6 +532,7 @@ public void Should_Correct_Existing_Format_To_Cobertura_When_Different_Format()
523
532
<DataCollectors>
524
533
<DataCollector friendlyName='Code Coverage' enabled='true'>
525
534
<Configuration>
535
+ <CodeCoverage/>
526
536
<Format>Cobertura</Format>
527
537
<FCCGenerated/>
528
538
</Configuration>
@@ -544,6 +554,7 @@ public void Should_Add_FCCGenerated_To_Existing_Configuration_Element()
544
554
<DataCollectors>
545
555
<DataCollector friendlyName='Code Coverage' enabled='true'>
546
556
<Configuration>
557
+ <CodeCoverage/>
547
558
<Format>Cobertura</Format>
548
559
</Configuration>
549
560
</DataCollector>
@@ -562,6 +573,7 @@ public void Should_Add_FCCGenerated_To_Existing_Configuration_Element()
562
573
<DataCollectors>
563
574
<DataCollector friendlyName='Code Coverage' enabled='true'>
564
575
<Configuration>
576
+ <CodeCoverage/>
565
577
<Format>Cobertura</Format>
566
578
<FCCGenerated/>
567
579
</Configuration>
@@ -574,7 +586,7 @@ public void Should_Add_FCCGenerated_To_Existing_Configuration_Element()
574
586
}
575
587
576
588
[ Test ]
577
- public void Should_Add_Configuration_Element_If_Not_Present_To_Existing_Ms_DataCollector ( )
589
+ public void Should_Add_Replaceable_Configuration_Element_If_Not_Present_To_Existing_Ms_DataCollector ( )
578
590
{
579
591
var custom = $@ "
580
592
<RunSettings>
@@ -588,6 +600,7 @@ public void Should_Add_Configuration_Element_If_Not_Present_To_Existing_Ms_DataC
588
600
589
601
var replacements = new RunSettingsTemplateReplacements
590
602
{
603
+ PublicKeyTokensInclude = "<PublicKeyTokensInclude/>"
591
604
} ;
592
605
593
606
var expected = $@ "
@@ -597,6 +610,123 @@ public void Should_Add_Configuration_Element_If_Not_Present_To_Existing_Ms_DataC
597
610
<DataCollectors>
598
611
<DataCollector friendlyName='Code Coverage' enabled='true'>
599
612
<Configuration>
613
+ <CodeCoverage>
614
+ <ModulePaths>
615
+ <Exclude>
616
+ </Exclude>
617
+ <Include>
618
+ </Include>
619
+ </ModulePaths>
620
+ <Functions>
621
+ <Exclude>
622
+ </Exclude>
623
+ <Include>
624
+ </Include>
625
+ </Functions>
626
+ <Attributes>
627
+ <Exclude>
628
+ </Exclude>
629
+ <Include>
630
+ </Include>
631
+ </Attributes>
632
+ <Sources>
633
+ <Exclude>
634
+ </Exclude>
635
+ <Include>
636
+ </Include>
637
+ </Sources>
638
+ <CompanyNames>
639
+ <Exclude>
640
+ </Exclude>
641
+ <Include>
642
+ </Include>
643
+ </CompanyNames>
644
+ <PublicKeyTokens>
645
+ <Exclude>
646
+ </Exclude>
647
+ <Include>
648
+ <PublicKeyTokensInclude/>
649
+ </Include>
650
+ </PublicKeyTokens>
651
+ </CodeCoverage>
652
+ <Format>Cobertura</Format>
653
+ <FCCGenerated/>
654
+ </Configuration>
655
+ </DataCollector>
656
+ </DataCollectors>
657
+ </DataCollectionRunSettings>
658
+ </RunSettings>" ;
659
+
660
+ ConfiguredCustomReplaceTest ( custom , expected , replacements ) ;
661
+ }
662
+
663
+ [ Test ]
664
+ public void Should_Add_Replaceable_CodeCoverage_Element_If_Not_Present_To_Existing_Ms_DataCollector ( )
665
+ {
666
+ var custom = $@ "
667
+ <RunSettings>
668
+ { nonReplacedRunConfiguration }
669
+ <DataCollectionRunSettings>
670
+ <DataCollectors>
671
+ <DataCollector friendlyName='Code Coverage' enabled='true'>
672
+ <Configuration>
673
+ </Configuration>
674
+ </DataCollector>
675
+ </DataCollectors>
676
+ </DataCollectionRunSettings>
677
+ </RunSettings>" ;
678
+
679
+ var replacements = new RunSettingsTemplateReplacements
680
+ {
681
+ PublicKeyTokensInclude = "<PublicKeyTokensInclude/>"
682
+ } ;
683
+
684
+ var expected = $@ "
685
+ <RunSettings>
686
+ { nonReplacedRunConfiguration }
687
+ <DataCollectionRunSettings>
688
+ <DataCollectors>
689
+ <DataCollector friendlyName='Code Coverage' enabled='true'>
690
+ <Configuration>
691
+ <CodeCoverage>
692
+ <ModulePaths>
693
+ <Exclude>
694
+ </Exclude>
695
+ <Include>
696
+ </Include>
697
+ </ModulePaths>
698
+ <Functions>
699
+ <Exclude>
700
+ </Exclude>
701
+ <Include>
702
+ </Include>
703
+ </Functions>
704
+ <Attributes>
705
+ <Exclude>
706
+ </Exclude>
707
+ <Include>
708
+ </Include>
709
+ </Attributes>
710
+ <Sources>
711
+ <Exclude>
712
+ </Exclude>
713
+ <Include>
714
+ </Include>
715
+ </Sources>
716
+ <CompanyNames>
717
+ <Exclude>
718
+ </Exclude>
719
+ <Include>
720
+ </Include>
721
+ </CompanyNames>
722
+ <PublicKeyTokens>
723
+ <Exclude>
724
+ </Exclude>
725
+ <Include>
726
+ <PublicKeyTokensInclude/>
727
+ </Include>
728
+ </PublicKeyTokens>
729
+ </CodeCoverage>
600
730
<Format>Cobertura</Format>
601
731
<FCCGenerated/>
602
732
</Configuration>
0 commit comments