Replace Assert.IsTrue with CollectionAssert.AreEqual for collection comparisons #1730
+93
−93
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Refactors collection equality assertions to use the more appropriate
CollectionAssert.AreEqualinstead ofAssert.IsTruewith.IsEqualTo()or.SequenceEqual().Changes
CollectionAssert.AreEqual(expected, actual)throughoutEncoding.UTF8.GetBytes(password).IsEqualTo(...)target.Handle.SequenceEqual(...).ToArray()forIEnumerableresults from.Skip()byte[].Take()(custom, returnsbyte[]) and LINQTake()(returnsIEnumerable)CollectionAssert.AreEqual(..., ..., message)Example
Before:
After:
Note
111 IDE0005 warnings about unnecessary
using System.Linq;directives remain - these can be auto-fixed separately.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
3a96ffa1915a49dfb84b11f5b244795058982f06ee364cc49f621a6c0d464dbe/usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/SSH.NET/SSH.NET/test/Renci.SshNet.Tests/bin/Debug/net8.0/Renci.SshNet.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/SSH.NET/SSH.NET/test/Renci.SshNet.Tests/bin/Debug/net8.0/Renci.SshNet.Tests.deps.json /home/REDACTED/work/SSH.NET/SSH.NET/test/Renci.SshNet.Tests/bin/Debug/net8.0/testhost.dll --port 42663 --endpoint 127.0.0.1:042663 --role client --parentprocessid 3812 --telemetryoptedin false(dns block)6afc99696eee4389a33595c9cfe404bb/usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/SSH.NET/SSH.NET/test/Renci.SshNet.Tests/bin/Debug/net8.0/Renci.SshNet.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/SSH.NET/SSH.NET/test/Renci.SshNet.Tests/bin/Debug/net8.0/Renci.SshNet.Tests.deps.json /home/REDACTED/work/SSH.NET/SSH.NET/test/Renci.SshNet.Tests/bin/Debug/net8.0/testhost.dll --port 38561 --endpoint 127.0.0.1:038561 --role client --parentprocessid 7070 --telemetryoptedin false(dns block)6ba3b85ace0440d6b94db473a84aeb7b/usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/SSH.NET/SSH.NET/test/Renci.SshNet.Tests/bin/Debug/net9.0/Renci.SshNet.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/SSH.NET/SSH.NET/test/Renci.SshNet.Tests/bin/Debug/net9.0/Renci.SshNet.Tests.deps.json /home/REDACTED/work/SSH.NET/SSH.NET/test/Renci.SshNet.Tests/bin/Debug/net9.0/testhost.dll --port 43833 --endpoint 127.0.0.1:043833 --role client --parentprocessid 3805 --telemetryoptedin false(dns block)71484929c936441fa41ab97af04193c8a835272fa37946bb8e12b38844fd1b79b07c59bc49954075aab99d0334a6206a/usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/SSH.NET/SSH.NET/test/Renci.SshNet.Tests/bin/Debug/net8.0/Renci.SshNet.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/SSH.NET/SSH.NET/test/Renci.SshNet.Tests/bin/Debug/net8.0/Renci.SshNet.Tests.deps.json /home/REDACTED/work/SSH.NET/SSH.NET/test/Renci.SshNet.Tests/bin/Debug/net8.0/testhost.dll --port 38561 --endpoint 127.0.0.1:038561 --role client --parentprocessid 7070 --telemetryoptedin false(dns block)be67715d7d0e4b678b2ca0715c4389ea/usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/SSH.NET/SSH.NET/test/Renci.SshNet.Tests/bin/Debug/net9.0/Renci.SshNet.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/SSH.NET/SSH.NET/test/Renci.SshNet.Tests/bin/Debug/net9.0/Renci.SshNet.Tests.deps.json /home/REDACTED/work/SSH.NET/SSH.NET/test/Renci.SshNet.Tests/bin/Debug/net9.0/testhost.dll --port 43833 --endpoint 127.0.0.1:043833 --role client --parentprocessid 3805 --telemetryoptedin false(dns block)invalid/usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/SSH.NET/SSH.NET/test/Renci.SshNet.Tests/bin/Debug/net8.0/Renci.SshNet.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/SSH.NET/SSH.NET/test/Renci.SshNet.Tests/bin/Debug/net8.0/Renci.SshNet.Tests.deps.json /home/REDACTED/work/SSH.NET/SSH.NET/test/Renci.SshNet.Tests/bin/Debug/net8.0/testhost.dll --port 42663 --endpoint 127.0.0.1:042663 --role client --parentprocessid 3812 --telemetryoptedin false(dns block)/usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/SSH.NET/SSH.NET/test/Renci.SshNet.Tests/bin/Debug/net9.0/Renci.SshNet.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/SSH.NET/SSH.NET/test/Renci.SshNet.Tests/bin/Debug/net9.0/Renci.SshNet.Tests.deps.json /home/REDACTED/work/SSH.NET/SSH.NET/test/Renci.SshNet.Tests/bin/Debug/net9.0/testhost.dll --port 43833 --endpoint 127.0.0.1:043833 --role client --parentprocessid 3805 --telemetryoptedin false(dns block)/usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/SSH.NET/SSH.NET/test/Renci.SshNet.Tests/bin/Debug/net9.0/Renci.SshNet.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/SSH.NET/SSH.NET/test/Renci.SshNet.Tests/bin/Debug/net9.0/Renci.SshNet.Tests.deps.json /home/REDACTED/work/SSH.NET/SSH.NET/test/Renci.SshNet.Tests/bin/Debug/net9.0/testhost.dll --port 43113 --endpoint 127.0.0.1:043113 --role client --parentprocessid 7062 --telemetryoptedin false(dns block)If you need me to access, download, or install something from one of these locations, you can either:
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.