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

Merged
merged 8 commits into from
May 16, 2024
Merged

Conversation

pavel-mikula-sonarsource
Copy link
Contributor

No description provided.

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
Copy link

sonarcloud bot commented May 16, 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 May 16, 2024

@pavel-mikula-sonarsource pavel-mikula-sonarsource merged commit 2d1753a into master May 16, 2024
26 checks passed
Best Kanban automation moved this from Review approved to Validate Peach May 16, 2024
@pavel-mikula-sonarsource pavel-mikula-sonarsource deleted the Pavel/NSubstitute branch May 16, 2024 11:41
@pavel-mikula-sonarsource pavel-mikula-sonarsource moved this from Validate Peach to Done in Best Kanban May 22, 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
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants