New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UTs: Replace Moq with NSubsitute #9206
base: master
Are you sure you want to change the base?
Conversation
91e088a
to
b0af752
Compare
Quality Gate passed for 'Sonar .NET Java Plugin'Issues Measures |
Quality Gate passed for 'SonarAnalyzer for .NET'Issues Measures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
tree.SetupGet(x => x.Encoding).Returns(() => null); | ||
var tree = Substitute.For<SyntaxTree>(); | ||
tree.FilePath.Returns("File.Generated.cs"); // Generated to simplify mocking for GeneratedCodeRecognizer | ||
tree.Encoding.Returns(x => null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tree.Encoding.Returns(x => null); | |
tree.Encoding.Returns(_ => null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like discards on the source side. The x
doesn't cost anything, the _
costs changing it to x
incase we'd use it in the future
@pavel-mikula-sonarsource this was approved with a minor comment, I'm not sure why the card didn't move to the approved column. Feel free to merge after rebase |
No description provided.