Skip to content

Commit 00d7450

Browse files
authored
added test (#70)
1 parent 9ca05f6 commit 00d7450

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

src/FluentAssertions.Analyzers.Tests/Tips/SanityTests.cs

+24
Original file line numberDiff line numberDiff line change
@@ -209,5 +209,29 @@ public static void Main()
209209

210210
DiagnosticVerifier.VerifyCSharpDiagnosticUsingAllAnalyzers(source);
211211
}
212+
213+
[TestMethod]
214+
[Implemented(Reason = "https://github.com/fluentassertions/fluentassertions.analyzers/issues/66")]
215+
public void CollectionShouldHaveElementAt_ShouldNotThrow()
216+
{
217+
const string source = @"
218+
using System.Linq;
219+
using FluentAssertions;
220+
using FluentAssertions.Extensions;
221+
222+
namespace TestNamespace
223+
{
224+
public class Program
225+
{
226+
public static void Main()
227+
{
228+
var list = new[] { "" FOO "" };
229+
list[0].Trim().Should().Be(""FOO"");
230+
}
231+
}
232+
}";
233+
234+
DiagnosticVerifier.VerifyCSharpDiagnosticUsingAllAnalyzers(source);
235+
}
212236
}
213237
}

0 commit comments

Comments
 (0)