@@ -119,9 +119,9 @@ public static void Main()
119119 System.Console.WriteLine();
120120 }
121121}" ;
122-
122+
123123 DiagnosticVerifier . VerifyCSharpDiagnosticUsingAllAnalyzers ( source ) ;
124- }
124+ }
125125
126126 [ TestMethod ]
127127 [ Implemented ( Reason = "https://github.com/fluentassertions/fluentassertions.analyzers/issues/63" ) ]
@@ -147,7 +147,7 @@ public static void Main()
147147 }
148148 }
149149}" ;
150-
150+
151151 DiagnosticVerifier . VerifyCSharpDiagnosticUsingAllAnalyzers ( source ) ;
152152 }
153153
@@ -193,7 +193,7 @@ public static void Main()
193193 [ TestMethod ]
194194 [ Implemented ( Reason = "https://github.com/fluentassertions/fluentassertions.analyzers/issues/64" ) ]
195195 public void CollectionShouldNotContainProperty_WhenAssertionIsIdiomatic_ShouldNotTrigger ( )
196- {
196+ {
197197 const string source = @"
198198using FluentAssertions;
199199using FluentAssertions.Extensions;
@@ -205,7 +205,7 @@ public static void Main()
205205 var list = new[] { string.Empty };
206206 list.Should().OnlyContain(e => e.Contains(string.Empty));
207207 }
208- }" ;
208+ }" ;
209209
210210 DiagnosticVerifier . VerifyCSharpDiagnosticUsingAllAnalyzers ( source ) ;
211211 }
@@ -233,5 +233,30 @@ public static void Main()
233233
234234 DiagnosticVerifier . VerifyCSharpDiagnosticUsingAllAnalyzers ( source ) ;
235235 }
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+ }
236261 }
237262}
0 commit comments