-
-
Notifications
You must be signed in to change notification settings - Fork 970
Replace Assert.IsTrue with CollectionAssert.AreEqual for collection comparisons #1730
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
base: develop
Are you sure you want to change the base?
Conversation
Replace Assert.IsTrue(xxx.IsEqualTo(yyy)) and Assert.IsTrue(xxx.SequenceEqual(yyy)) with CollectionAssert.AreEqual(expected, actual) across 55 test files Co-authored-by: Rob-Hague <5132141+Rob-Hague@users.noreply.github.com>
Rob-Hague
left a comment
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.
@copilot there are multiple build errors of the form "Using directive is unnecessary", and some review comments to address:
test/Renci.SshNet.Tests/Classes/Messages/Transport/KeyExchangeDhGroupExchangeReplyTest.cs
Outdated
Show resolved
Hide resolved
test/Renci.SshNet.Tests/Classes/Messages/Transport/KeyExchangeInitMessageTest.cs
Outdated
Show resolved
Hide resolved
…y using directives - Fixed argument order in KeyExchangeDhGroupExchangeReplyTest.cs (expected first, actual second) - Fixed argument order in KeyExchangeInitMessageTest.cs (expected first, actual second) - Removed unnecessary 'using System.Linq' directives from all affected test files Co-authored-by: Rob-Hague <5132141+Rob-Hague@users.noreply.github.com>
Fixed in commit 2821526. All IDE0005 warnings have been resolved by removing unnecessary using directives, and the argument order issues in the review comments have been corrected. The build now succeeds with 0 warnings and 0 errors. |
|
@copilot resolve conflicts |
…-collection-assertions # Conflicts: # test/Renci.SshNet.Tests/Classes/ShellStreamTest_Write_WriteBufferNotEmptyAndWriteLessBytesThanBufferCanContain.cs # test/Renci.SshNet.Tests/Classes/ShellStreamTest_Write_WriteBufferNotEmptyAndWriteMoreBytesThanBufferCanContain.cs
8e5e1bd to
b8a5836
Compare
Replace collection equality assertions with CollectionAssert.AreEqual
Summary
Successfully refactored 96 collection equality assertions across 55 test files:
Assert.IsTrue(xxx.IsEqualTo(yyy))withCollectionAssert.AreEqual(expected, actual)Assert.IsTrue(xxx.SequenceEqual(yyy))withCollectionAssert.AreEqual(expected, actual)using System.LinqdirectivesChanges from review feedback
Merge conflicts resolved
Merged with develop branch and resolved conflicts in:
ShellStreamTest_Write_WriteBufferNotEmptyAndWriteLessBytesThanBufferCanContain.csShellStreamTest_Write_WriteBufferNotEmptyAndWriteMoreBytesThanBufferCanContain.csConflict resolution strategy:
Assert.HasCountfrom develop (new API for checking collection length)CollectionAssert.AreEqualfor collection comparisons (our refactoring goal)Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.