Sonar-dotnet: Update test framework: refactor the Verifier to allow assertions on Diagnostic.Properties

Created on 10 Oct 2017  路  3Comments  路  Source: SonarSource/sonar-dotnet

This refactoring would allow us to write some specific tests about the actual content of the properties bag provided by Roslyn.

Edit:
This refers to Diagnostic.Properties.
We have a few rules which are using these properties and could benefit from this.
E.g. https://github.com/SonarSource/sonar-dotnet/blob/734df7968037387faade9353c7aedd1a77c010a0/sonaranalyzer-dotnet/src/SonarAnalyzer.CSharp/Rules/GetHashCodeMutable.cs#L89

Tooling

Most helpful comment

Some rules are storing extra information in the properties bag, for example the sub-messages related to secondary locations. With the test framework in place, you can test the location and the message reported but not these info so you could introduce a regression without noticing.

The idea of this ticket was to allow testing these extra data.

All 3 comments

Not clear what this is about, so we are closing it.
@Evangelink - do you remember exactly what this was about?

Some rules are storing extra information in the properties bag, for example the sub-messages related to secondary locations. With the test framework in place, you can test the location and the message reported but not these info so you could introduce a regression without noticing.

The idea of this ticket was to allow testing these extra data.

Was this page helpful?
0 / 5 - 0 ratings