@@ -26,14 +26,10 @@ public class AssertionDiagnosticAttribute : Attribute, ITestDataSource
2626{
2727 public string Assertion { get ; }
2828
29- public bool Ignore { get ; }
30-
31- public AssertionDiagnosticAttribute ( string assertion , bool ignore = false ) => ( Assertion , Ignore ) = ( assertion , ignore ) ;
29+ public AssertionDiagnosticAttribute ( string assertion ) => Assertion = assertion ;
3230
3331 public IEnumerable < object [ ] > GetData ( MethodInfo methodInfo )
3432 {
35- if ( Ignore ) yield break ;
36-
3733 foreach ( var assertion in TestCasesInputUtils . GetTestCases ( Assertion ) )
3834 {
3935 yield return new object [ ] { assertion } ;
@@ -43,20 +39,24 @@ public IEnumerable<object[]> GetData(MethodInfo methodInfo)
4339 public string GetDisplayName ( MethodInfo methodInfo , object [ ] data ) => $ "{ methodInfo . Name } (\" { data [ 0 ] } \" )";
4440}
4541
42+ [ AttributeUsage ( AttributeTargets . Method , AllowMultiple = true ) ]
43+ public class IgnoreAssertionDiagnosticAttribute : Attribute
44+ {
45+ public string Assertion { get ; }
46+
47+ public IgnoreAssertionDiagnosticAttribute ( string assertion ) => Assertion = assertion ;
48+ }
49+
4650[ AttributeUsage ( AttributeTargets . Method , AllowMultiple = true ) ]
4751public class AssertionCodeFixAttribute : Attribute , ITestDataSource
4852{
4953 public string OldAssertion { get ; }
5054 public string NewAssertion { get ; }
5155
52- public bool Ignore { get ; }
53-
54- public AssertionCodeFixAttribute ( string oldAssertion , string newAssertion , bool ignore = false ) => ( OldAssertion , NewAssertion , Ignore ) = ( oldAssertion , newAssertion , ignore ) ;
56+ public AssertionCodeFixAttribute ( string oldAssertion , string newAssertion ) => ( OldAssertion , NewAssertion ) = ( oldAssertion , newAssertion ) ;
5557
5658 public IEnumerable < object [ ] > GetData ( MethodInfo methodInfo )
5759 {
58- if ( Ignore ) yield break ;
59-
6060 foreach ( var ( oldAssertion , newAssertion ) in TestCasesInputUtils . GetTestCases ( OldAssertion , NewAssertion ) )
6161 {
6262 yield return new object [ ] { oldAssertion , newAssertion } ;
@@ -66,22 +66,27 @@ public IEnumerable<object[]> GetData(MethodInfo methodInfo)
6666 public string GetDisplayName ( MethodInfo methodInfo , object [ ] data ) => $ "{ methodInfo . Name } (\" old: { data [ 0 ] } \" , new: { data [ 1 ] } \" )";
6767}
6868
69+ [ AttributeUsage ( AttributeTargets . Method , AllowMultiple = true ) ]
70+ public class IgnoreAssertionCodeFixAttribute : Attribute
71+ {
72+ public string OldAssertion { get ; }
73+ public string NewAssertion { get ; }
74+
75+ public IgnoreAssertionCodeFixAttribute ( string oldAssertion , string newAssertion ) => ( OldAssertion , NewAssertion ) = ( oldAssertion , newAssertion ) ;
76+ }
77+
6978[ AttributeUsage ( AttributeTargets . Method , AllowMultiple = true ) ]
7079public class AssertionMethodCodeFixAttribute : Attribute , ITestDataSource
7180{
7281 public string MethodArguments { get ; }
7382 public string OldAssertion { get ; }
7483 public string NewAssertion { get ; }
7584
76- public bool Ignore { get ; }
77-
78- public AssertionMethodCodeFixAttribute ( string methodArguments , string oldAssertion , string newAssertion , bool ignore = false )
79- => ( MethodArguments , OldAssertion , NewAssertion , Ignore ) = ( methodArguments , oldAssertion , newAssertion , ignore ) ;
85+ public AssertionMethodCodeFixAttribute ( string methodArguments , string oldAssertion , string newAssertion )
86+ => ( MethodArguments , OldAssertion , NewAssertion ) = ( methodArguments , oldAssertion , newAssertion ) ;
8087
8188 public IEnumerable < object [ ] > GetData ( MethodInfo methodInfo )
8289 {
83- if ( Ignore ) yield break ;
84-
8590 foreach ( var ( oldAssertion , newAssertion ) in TestCasesInputUtils . GetTestCases ( OldAssertion , NewAssertion ) )
8691 {
8792 yield return new object [ ] { MethodArguments , oldAssertion , newAssertion } ;
@@ -91,6 +96,17 @@ public IEnumerable<object[]> GetData(MethodInfo methodInfo)
9196 public string GetDisplayName ( MethodInfo methodInfo , object [ ] data ) => $ "{ methodInfo . Name } (\" arguments\" :{ data [ 0 ] } , \" old: { data [ 1 ] } \" , new: { data [ 2 ] } \" )";
9297}
9398
99+ [ AttributeUsage ( AttributeTargets . Method , AllowMultiple = true ) ]
100+ public class IgnoreAssertionMethodCodeFixAttribute : Attribute
101+ {
102+ public string MethodArguments { get ; }
103+ public string OldAssertion { get ; }
104+ public string NewAssertion { get ; }
105+
106+ public IgnoreAssertionMethodCodeFixAttribute ( string methodArguments , string oldAssertion , string newAssertion )
107+ => ( MethodArguments , OldAssertion , NewAssertion ) = ( methodArguments , oldAssertion , newAssertion ) ;
108+ }
109+
94110public static class TestCasesInputUtils
95111{
96112 private static readonly string Empty = string . Empty ;
0 commit comments