You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I used Visual Studio 2019 Preview (community) to create the solution from a template because I couldn't get it work with the regular version of Visual Studio 2019 community. In the unit testing portion, it has created tests that look like this:
public async Task TestMethod2()
Whereas the tutorial does not allude to tagging test methods with 'async'. Also, the tutorial shows to create a new instance of DiagnosticResult and populate several properties:
In the code I'm working on, this does not seem to work as these properties are apparently read-only. It appears that the template created code that is newer than what the tutorial describes. I'm not sure how to proceed here. Is what the template has created the new way of doing things or something experimental that will be abandoned? If it is the new way of doing things, is there any documentation on things like the WithLocation method? Can I still use the tutorial's approach by using an older library? I'd love some suggestions on how to get unblocked.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello,
I've been going through this tutorial ( https://docs.microsoft.com/en-us/dotnet/csharp/roslyn-sdk/tutorials/how-to-write-csharp-analyzer-code-fix ) and have made it to the unit testing section.
I used Visual Studio 2019 Preview (community) to create the solution from a template because I couldn't get it work with the regular version of Visual Studio 2019 community. In the unit testing portion, it has created tests that look like this:
public async Task TestMethod2()
Whereas the tutorial does not allude to tagging test methods with 'async'. Also, the tutorial shows to create a new instance of DiagnosticResult and populate several properties:
In the code I'm working on, this does not seem to work as these properties are apparently read-only. It appears that the template created code that is newer than what the tutorial describes. I'm not sure how to proceed here. Is what the template has created the new way of doing things or something experimental that will be abandoned? If it is the new way of doing things, is there any documentation on things like the WithLocation method? Can I still use the tutorial's approach by using an older library? I'd love some suggestions on how to get unblocked.
Beta Was this translation helpful? Give feedback.
All reactions