Skip to content
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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

pavel-mikula-sonarsource
Copy link
Contributor

No description provided.

Copy link

sonarcloud bot commented Apr 26, 2024

Quality Gate Passed Quality Gate passed for 'Sonar .NET Java Plugin'

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

Copy link

sonarcloud bot commented Apr 26, 2024

@github-actions github-actions bot moved this from In progress to Review in progress in Best Kanban Apr 26, 2024
Copy link
Contributor

@CristianAmbrosini CristianAmbrosini left a 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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
tree.Encoding.Returns(x => null);
tree.Encoding.Returns(_ => null);

Copy link
Contributor Author

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

@CristianAmbrosini
Copy link
Contributor

@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

@CristianAmbrosini CristianAmbrosini moved this from Review in progress to Review approved in Best Kanban May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Best Kanban
  
Review approved
Development

Successfully merging this pull request may close these issues.

None yet

2 participants