Skip to content

Commit

Permalink
reproduce flow with failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
Meir017 committed Aug 20, 2023
1 parent 6ae598f commit 401db5d
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions src/FluentAssertions.Analyzers.Tests/Tips/SanityTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -314,5 +314,37 @@ public static void True(bool input)
Locations = new[] { new DiagnosticResultLocation("Test0.cs", 7, 9) }
});
}

[TestMethod]
[Implemented(Reason = "https://github.com/fluentassertions/fluentassertions.analyzers/issues/207")]
public void PropertiesOfTypes()
{
const string globalUsings = @"
global using Xunit;
global using FluentAssertions;
global using FluentAssertions.Extensions;";
const string source = @"
public class TestClass
{
public static void Main()
{
var x = new TestType();
x.List.Any().Should().BeTrue();
}
}
public class TestType
{
public List<int> List { get; set; }
}";

DiagnosticVerifier.VerifyCSharpDiagnosticUsingAllAnalyzers(new[] { source, globalUsings }, new DiagnosticResult()
{
Id = AssertTrueAnalyzer.DiagnosticId,
Message = AssertTrueAnalyzer.Message,
Severity = DiagnosticSeverity.Info,
Locations = new[] { new DiagnosticResultLocation("Test0.cs", 7, 9) }
});
}
}
}

0 comments on commit 401db5d

Please sign in to comment.