@@ -603,31 +603,33 @@ public void Bar()
603
603
await VerifyCSharpDiagnosticAsync ( testCode , DiagnosticResult . EmptyDiagnosticResults , CancellationToken . None ) . ConfigureAwait ( false ) ;
604
604
}
605
605
606
- [ Fact ]
607
- public async Task TestAttributeOpeningParenthesisOnTheNextLineAsync ( )
606
+ [ Theory ]
607
+ [ InlineData ( "Conditional" ) ]
608
+ [ InlineData ( "System.Diagnostics.Conditional" ) ]
609
+ public async Task TestAttributeOpeningParenthesisOnTheNextLineAsync ( string attributeName )
608
610
{
609
- var testCode = @"
611
+ var testCode = $ @ "
610
612
using System.Diagnostics;
611
613
public class Foo
612
- {
613
- [Conditional
614
- (""DEBUG""), Conditional
614
+ {{
615
+ [{ attributeName }
616
+ (""DEBUG""), { attributeName }
615
617
(""TEST1"")]
616
618
public void Baz()
617
- {
618
- }
619
- }" ;
620
- var fixedCode = @"
619
+ {{
620
+ }}
621
+ }} " ;
622
+ var fixedCode = $ @ "
621
623
using System.Diagnostics;
622
624
public class Foo
623
- {
624
- [Conditional (
625
- ""DEBUG""), Conditional (
625
+ {{
626
+ [{ attributeName } (
627
+ ""DEBUG""), { attributeName } (
626
628
""TEST1"")]
627
629
public void Baz()
628
- {
629
- }
630
- }" ;
630
+ {{
631
+ }}
632
+ }} " ;
631
633
632
634
DiagnosticResult [ ] expected =
633
635
{
@@ -638,19 +640,21 @@ public void Baz()
638
640
await VerifyCSharpFixAsync ( testCode , expected , fixedCode , CancellationToken . None ) . ConfigureAwait ( false ) ;
639
641
}
640
642
641
- [ Fact ]
642
- public async Task TestAttributeOpeningParenthesisOnTheSameLineAsync ( )
643
+ [ Theory ]
644
+ [ InlineData ( "Conditional" ) ]
645
+ [ InlineData ( "System.Diagnostics.Conditional" ) ]
646
+ public async Task TestAttributeOpeningParenthesisOnTheSameLineAsync ( string attributeName )
643
647
{
644
- var testCode = @"
648
+ var testCode = $ @ "
645
649
using System.Diagnostics;
646
650
public class Foo
647
- {
648
- [Conditional (""DEBUG""), Conditional (""TEST1"")]
651
+ {{
652
+ [{ attributeName } (""DEBUG""), { attributeName } (""TEST1"")]
649
653
public void Baz()
650
- {
654
+ {{
651
655
652
- }
653
- }" ;
656
+ }}
657
+ }} " ;
654
658
655
659
await VerifyCSharpDiagnosticAsync ( testCode , DiagnosticResult . EmptyDiagnosticResults , CancellationToken . None ) . ConfigureAwait ( false ) ;
656
660
}
0 commit comments