dotnet / roslyn-analyzers

MIT License
1.59k stars 466 forks source link

GetCSharpResultAt/GetBasicResultAt test helpers #3088

Open Evangelink opened 4 years ago

Evangelink commented 4 years ago

Discussion initiated in https://github.com/dotnet/roslyn-analyzers/pull/3057#discussion_r353774902

In branch master or 2.9.x we have created a bunch of GetCSharpResultAt/GetBasicResultAt test helpers.

It would be better to discuss and align on a clear direction for the structure of the tests. For now, there are 3 main options:

1/ Keep all of those helpers knowing that a lot of them are exactly the same and so we have some duplicated boilerplate in most of the tests.

2/ Get rid of the helpers and always "force" users to use the full syntax (i.e. VerifyCS/VB.Diagnostic().WithLocation()...

3/ Introduce some overloads to the Diagnostic method of VerifyCS/VB to allow passing line, column and arguments.

cc @sharwell and @mavasani

sharwell commented 4 years ago

I would consider this blocked on https://github.com/dotnet/roslyn-sdk/issues/411. If we find a way to indicate the spans in markup and only have the messaging in the diagnostics, it could be preferable to any of the options listed above.

Evangelink commented 4 years ago

@mavasani @sharwell This issue is no longer blocked.