@@ -119,9 +119,9 @@ public static void Main()
119
119
System.Console.WriteLine();
120
120
}
121
121
}" ;
122
-
122
+
123
123
DiagnosticVerifier . VerifyCSharpDiagnosticUsingAllAnalyzers ( source ) ;
124
- }
124
+ }
125
125
126
126
[ TestMethod ]
127
127
[ Implemented ( Reason = "https://github.com/fluentassertions/fluentassertions.analyzers/issues/63" ) ]
@@ -147,7 +147,7 @@ public static void Main()
147
147
}
148
148
}
149
149
}" ;
150
-
150
+
151
151
DiagnosticVerifier . VerifyCSharpDiagnosticUsingAllAnalyzers ( source ) ;
152
152
}
153
153
@@ -193,7 +193,7 @@ public static void Main()
193
193
[ TestMethod ]
194
194
[ Implemented ( Reason = "https://github.com/fluentassertions/fluentassertions.analyzers/issues/64" ) ]
195
195
public void CollectionShouldNotContainProperty_WhenAssertionIsIdiomatic_ShouldNotTrigger ( )
196
- {
196
+ {
197
197
const string source = @"
198
198
using FluentAssertions;
199
199
using FluentAssertions.Extensions;
@@ -205,7 +205,7 @@ public static void Main()
205
205
var list = new[] { string.Empty };
206
206
list.Should().OnlyContain(e => e.Contains(string.Empty));
207
207
}
208
- }" ;
208
+ }" ;
209
209
210
210
DiagnosticVerifier . VerifyCSharpDiagnosticUsingAllAnalyzers ( source ) ;
211
211
}
@@ -233,5 +233,30 @@ public static void Main()
233
233
234
234
DiagnosticVerifier . VerifyCSharpDiagnosticUsingAllAnalyzers ( source ) ;
235
235
}
236
+
237
+ [ TestMethod ]
238
+ [ Implemented ( Reason = "https://github.com/fluentassertions/fluentassertions.analyzers/issues/77" ) ]
239
+ public void DictionaryShouldHaveCount1_ShouldNotReport ( )
240
+ {
241
+ const string source = @"
242
+ using System.Linq;
243
+ using System.Collections.Generic;
244
+ using FluentAssertions;
245
+ using FluentAssertions.Extensions;
246
+
247
+ namespace TestNamespace
248
+ {
249
+ public class Program
250
+ {
251
+ public static void Main()
252
+ {
253
+ var dict = new Dictionary<string, object>();
254
+ dict.Should().HaveCount(1);
255
+ }
256
+ }
257
+ }" ;
258
+
259
+ DiagnosticVerifier . VerifyCSharpDiagnosticUsingAllAnalyzers ( source ) ;
260
+ }
236
261
}
237
262
}
0 commit comments