mirror of
https://github.com/sshnet/SSH.NET.git
synced 2026-09-10 01:05:42 +00:00
Replace Assert.IsTrue with CollectionAssert.AreEqual for collection comparisons (#1730)
* Initial plan * Refactor collection assertions to use CollectionAssert.AreEqual 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> * Fix argument order in CollectionAssert.AreEqual and remove unnecessary 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> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Rob-Hague <5132141+Rob-Hague@users.noreply.github.com> Co-authored-by: Rob Hague <rob.hague00@gmail.com>
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
using Renci.SshNet.Abstractions;
|
||||
|
||||
using System;
|
||||
using System;
|
||||
using System.Threading;
|
||||
using System.Security.Cryptography;
|
||||
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
using Renci.SshNet.Abstractions;
|
||||
|
||||
namespace Renci.SshNet.Tests.Classes
|
||||
{
|
||||
[TestClass]
|
||||
|
||||
+1
-1
@@ -110,7 +110,7 @@ namespace Renci.SshNet.Tests.Classes.Connection
|
||||
|
||||
Assert.HasCount(expected.Length + 2, _dataReceivedByServer);
|
||||
|
||||
Assert.IsTrue(expected.SequenceEqual(_dataReceivedByServer.Take(expected.Length)));
|
||||
CollectionAssert.AreEqual(expected, _dataReceivedByServer.Take(expected.Length).ToArray());
|
||||
Assert.AreEqual(Session.CarriageReturn, _dataReceivedByServer[_dataReceivedByServer.Count - 2]);
|
||||
Assert.AreEqual(Session.LineFeed, _dataReceivedByServer[_dataReceivedByServer.Count - 1]);
|
||||
}
|
||||
|
||||
+1
-1
@@ -112,7 +112,7 @@ namespace Renci.SshNet.Tests.Classes.Connection
|
||||
|
||||
Assert.HasCount(expected.Length + 2, _dataReceivedByServer);
|
||||
|
||||
Assert.IsTrue(expected.SequenceEqual(_dataReceivedByServer.Take(expected.Length)));
|
||||
CollectionAssert.AreEqual(expected, _dataReceivedByServer.Take(expected.Length).ToArray());
|
||||
Assert.AreEqual(Session.CarriageReturn, _dataReceivedByServer[_dataReceivedByServer.Count - 2]);
|
||||
Assert.AreEqual(Session.LineFeed, _dataReceivedByServer[_dataReceivedByServer.Count - 1]);
|
||||
}
|
||||
|
||||
+1
-1
@@ -96,7 +96,7 @@ namespace Renci.SshNet.Tests.Classes.Connection
|
||||
|
||||
Assert.HasCount(expected.Length + 2, _dataReceivedByServer);
|
||||
|
||||
Assert.IsTrue(expected.SequenceEqual(_dataReceivedByServer.Take(expected.Length)));
|
||||
CollectionAssert.AreEqual(expected, _dataReceivedByServer.Take(expected.Length).ToArray());
|
||||
Assert.AreEqual(Session.CarriageReturn, _dataReceivedByServer[_dataReceivedByServer.Count - 2]);
|
||||
Assert.AreEqual(Session.LineFeed, _dataReceivedByServer[_dataReceivedByServer.Count - 1]);
|
||||
}
|
||||
|
||||
+1
-1
@@ -99,7 +99,7 @@ namespace Renci.SshNet.Tests.Classes.Connection
|
||||
|
||||
Assert.HasCount(expected.Length + 2, _dataReceivedByServer);
|
||||
|
||||
Assert.IsTrue(expected.SequenceEqual(_dataReceivedByServer.Take(expected.Length)));
|
||||
CollectionAssert.AreEqual(expected, _dataReceivedByServer.Take(expected.Length).ToArray());
|
||||
Assert.AreEqual(Session.CarriageReturn, _dataReceivedByServer[_dataReceivedByServer.Count - 2]);
|
||||
Assert.AreEqual(Session.LineFeed, _dataReceivedByServer[_dataReceivedByServer.Count - 1]);
|
||||
}
|
||||
|
||||
+1
-1
@@ -96,7 +96,7 @@ namespace Renci.SshNet.Tests.Classes.Connection
|
||||
|
||||
Assert.HasCount(expected.Length + 2, _dataReceivedByServer);
|
||||
|
||||
Assert.IsTrue(expected.SequenceEqual(_dataReceivedByServer.Take(expected.Length)));
|
||||
CollectionAssert.AreEqual(expected, _dataReceivedByServer.Take(expected.Length).ToArray());
|
||||
Assert.AreEqual(Session.CarriageReturn, _dataReceivedByServer[_dataReceivedByServer.Count - 2]);
|
||||
Assert.AreEqual(Session.LineFeed, _dataReceivedByServer[_dataReceivedByServer.Count - 1]);
|
||||
}
|
||||
|
||||
+1
-1
@@ -98,7 +98,7 @@ namespace Renci.SshNet.Tests.Classes.Connection
|
||||
|
||||
Assert.HasCount(expected.Length + 2, _dataReceivedByServer);
|
||||
|
||||
Assert.IsTrue(expected.SequenceEqual(_dataReceivedByServer.Take(expected.Length)));
|
||||
CollectionAssert.AreEqual(expected, _dataReceivedByServer.Take(expected.Length).ToArray());
|
||||
Assert.AreEqual(Session.CarriageReturn, _dataReceivedByServer[_dataReceivedByServer.Count - 2]);
|
||||
Assert.AreEqual(Session.LineFeed, _dataReceivedByServer[_dataReceivedByServer.Count - 1]);
|
||||
}
|
||||
|
||||
+1
-1
@@ -99,7 +99,7 @@ namespace Renci.SshNet.Tests.Classes.Connection
|
||||
|
||||
Assert.HasCount(expected.Length + 2, _dataReceivedByServer);
|
||||
|
||||
Assert.IsTrue(expected.SequenceEqual(_dataReceivedByServer.Take(expected.Length)));
|
||||
CollectionAssert.AreEqual(expected, _dataReceivedByServer.Take(expected.Length).ToArray());
|
||||
Assert.AreEqual(Session.CarriageReturn, _dataReceivedByServer[_dataReceivedByServer.Count - 2]);
|
||||
Assert.AreEqual(Session.LineFeed, _dataReceivedByServer[_dataReceivedByServer.Count - 1]);
|
||||
}
|
||||
|
||||
+1
-2
@@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Sockets;
|
||||
using System.Threading;
|
||||
@@ -129,7 +128,7 @@ namespace Renci.SshNet.Tests.Classes.Connection
|
||||
PacketDump.Create(expectedSocksRequest, 2),
|
||||
PacketDump.Create(_bytesReceivedByProxy, 2));
|
||||
|
||||
Assert.IsTrue(expectedSocksRequest.SequenceEqual(_bytesReceivedByProxy), errorText);
|
||||
CollectionAssert.AreEqual(expectedSocksRequest, _bytesReceivedByProxy, errorText);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
|
||||
+1
-2
@@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Sockets;
|
||||
using System.Threading;
|
||||
@@ -187,7 +186,7 @@ namespace Renci.SshNet.Tests.Classes.Connection
|
||||
PacketDump.Create(expectedSocksRequest, 2),
|
||||
PacketDump.Create(_bytesReceivedByProxy, 2));
|
||||
|
||||
Assert.IsTrue(expectedSocksRequest.SequenceEqual(_bytesReceivedByProxy), errorText);
|
||||
CollectionAssert.AreEqual(expectedSocksRequest, _bytesReceivedByProxy, errorText);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
|
||||
+1
-2
@@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Sockets;
|
||||
using System.Text;
|
||||
@@ -145,7 +144,7 @@ namespace Renci.SshNet.Tests.Classes.Connection
|
||||
PacketDump.Create(expectedSocksRequest, 2),
|
||||
PacketDump.Create(_bytesReceivedByProxy, 2));
|
||||
|
||||
Assert.IsTrue(expectedSocksRequest.SequenceEqual(_bytesReceivedByProxy), errorText);
|
||||
CollectionAssert.AreEqual(expectedSocksRequest, _bytesReceivedByProxy, errorText);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
|
||||
+1
-2
@@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Sockets;
|
||||
using System.Text;
|
||||
@@ -201,7 +200,7 @@ namespace Renci.SshNet.Tests.Classes.Connection
|
||||
PacketDump.Create(expectedSocksRequest, 2),
|
||||
PacketDump.Create(_bytesReceivedByProxy, 2));
|
||||
|
||||
Assert.IsTrue(expectedSocksRequest.SequenceEqual(_bytesReceivedByProxy), errorText);
|
||||
CollectionAssert.AreEqual(expectedSocksRequest, _bytesReceivedByProxy, errorText);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
|
||||
+1
-2
@@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Sockets;
|
||||
using System.Threading;
|
||||
@@ -117,7 +116,7 @@ namespace Renci.SshNet.Tests.Classes.Connection
|
||||
PacketDump.Create(expectedSocksRequest, 2),
|
||||
PacketDump.Create(_bytesReceivedByProxy, 2));
|
||||
|
||||
Assert.IsTrue(expectedSocksRequest.SequenceEqual(_bytesReceivedByProxy), errorText);
|
||||
CollectionAssert.AreEqual(expectedSocksRequest, _bytesReceivedByProxy, errorText);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
|
||||
+1
-2
@@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Sockets;
|
||||
using System.Threading;
|
||||
@@ -115,7 +114,7 @@ namespace Renci.SshNet.Tests.Classes.Connection
|
||||
PacketDump.Create(expectedSocksRequest, 2),
|
||||
PacketDump.Create(_bytesReceivedByProxy, 2));
|
||||
|
||||
Assert.IsTrue(expectedSocksRequest.SequenceEqual(_bytesReceivedByProxy), errorText);
|
||||
CollectionAssert.AreEqual(expectedSocksRequest, _bytesReceivedByProxy, errorText);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
|
||||
@@ -124,7 +124,7 @@ namespace Renci.SshNet.Tests.Classes.Messages.Connection
|
||||
|
||||
var actualData = new byte[size];
|
||||
_ = sshDataStream.Read(actualData, 0, size);
|
||||
Assert.IsTrue(actualData.SequenceEqual(data.Take(offset, size)));
|
||||
CollectionAssert.AreEqual(data.Take(offset, size), actualData);
|
||||
|
||||
Assert.IsTrue(sshDataStream.IsEndOfData);
|
||||
}
|
||||
|
||||
+2
-3
@@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
@@ -103,7 +102,7 @@ namespace Renci.SshNet.Tests.Classes.Messages.Connection
|
||||
|
||||
var actualChannelType = new byte[actualChannelTypeLength];
|
||||
_ = sshDataStream.Read(actualChannelType, 0, (int)actualChannelTypeLength);
|
||||
Assert.IsTrue(target.ChannelType.SequenceEqual(actualChannelType));
|
||||
CollectionAssert.AreEqual(target.ChannelType, actualChannelType);
|
||||
|
||||
Assert.AreEqual(localChannelNumber, sshDataStream.ReadUInt32());
|
||||
Assert.AreEqual(initialWindowSize, sshDataStream.ReadUInt32());
|
||||
@@ -111,7 +110,7 @@ namespace Renci.SshNet.Tests.Classes.Messages.Connection
|
||||
|
||||
var actualInfo = new byte[infoBytes.Length];
|
||||
_ = sshDataStream.Read(actualInfo, 0, actualInfo.Length);
|
||||
Assert.IsTrue(infoBytes.SequenceEqual(actualInfo));
|
||||
CollectionAssert.AreEqual(infoBytes, actualInfo);
|
||||
|
||||
Assert.IsTrue(sshDataStream.IsEndOfData);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
@@ -75,7 +74,7 @@ namespace Renci.SshNet.Tests.Classes.Messages.Transport
|
||||
|
||||
var actualData = new byte[_data.Length];
|
||||
_ = sshDataStream.Read(actualData, 0, actualData.Length);
|
||||
Assert.IsTrue(_data.SequenceEqual(actualData));
|
||||
CollectionAssert.AreEqual(_data, actualData);
|
||||
|
||||
Assert.IsTrue(sshDataStream.IsEndOfData);
|
||||
}
|
||||
|
||||
+4
-6
@@ -1,6 +1,4 @@
|
||||
using System.Linq;
|
||||
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
using Renci.SshNet.Messages.Transport;
|
||||
using Renci.SshNet.Tests.Common;
|
||||
@@ -23,9 +21,9 @@ namespace Renci.SshNet.Tests.Classes.Messages.Transport
|
||||
var input = new byte[] { 0x00, 0x00, 0x01, 0x17, 0x00, 0x00, 0x00, 0x07, 0x73, 0x73, 0x68, 0x2d, 0x72, 0x73, 0x61, 0x00, 0x00, 0x00, 0x03, 0x01, 0x00, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0xce, 0x38, 0xdf, 0x0d, 0x04, 0x2c, 0x10, 0x45, 0x8f, 0x5e, 0xeb, 0xc2, 0x35, 0x01, 0xd5, 0x4d, 0x09, 0xa3, 0xee, 0x74, 0x3d, 0x75, 0xcf, 0xf4, 0xf3, 0x4f, 0xc9, 0xf9, 0x2e, 0x59, 0xd6, 0xb8, 0x69, 0x85, 0x16, 0xac, 0x33, 0x5b, 0x2a, 0x2a, 0xf8, 0x9c, 0xc4, 0xc3, 0x87, 0xd6, 0xb8, 0x50, 0x6c, 0xed, 0x60, 0x9c, 0x0f, 0x83, 0x37, 0xb3, 0xa2, 0x25, 0xbe, 0x07, 0xde, 0xb6, 0x1f, 0x28, 0xab, 0x05, 0x21, 0xc0, 0x23, 0xf7, 0xd6, 0xca, 0xcb, 0x03, 0x42, 0x69, 0x31, 0x93, 0x2b, 0x3b, 0x94, 0xb8, 0x3b, 0x90, 0xe6, 0x25, 0x7c, 0x23, 0xc5, 0x24, 0x89, 0x65, 0x37, 0x7b, 0x56, 0x54, 0xa2, 0x23, 0xcb, 0xeb, 0xf0, 0xe9, 0xd1, 0x07, 0x88, 0x36, 0x8f, 0xef, 0x65, 0x71, 0xac, 0x80,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input);
|
||||
|
||||
Assert.IsTrue(m.HostKey.SequenceEqual(new byte[] { 0x00, 0x00, 0x00, 0x07, 0x73, 0x73, 0x68, 0x2d, 0x72, 0x73, 0x61, 0x00, 0x00, 0x00, 0x03, 0x01, 0x00, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0xce, 0x38, 0xdf, 0x0d, 0x04, 0x2c, 0x10, 0x45, 0x8f, 0x5e, 0xeb, 0xc2, 0x35, 0x01, 0xd5, 0x4d, 0x09, 0xa3, 0xee, 0x74, 0x3d, 0x75, 0xcf, 0xf4, 0xf3, 0x4f, 0xc9, 0xf9, 0x2e, 0x59, 0xd6, 0xb8, 0x69, 0x85, 0x16, 0xac, 0x33, 0x5b, 0x2a, 0x2a, 0xf8, 0x9c, 0xc4, 0xc3, 0x87, 0xd6, 0xb8, 0x50, 0x6c, 0xed, 0x60, 0x9c, 0x0f, 0x83, 0x37, 0xb3, 0xa2, 0x25, 0xbe, 0x07, 0xde, 0xb6, 0x1f, 0x28, 0xab, 0x05, 0x21, 0xc0, 0x23, 0xf7, 0xd6, 0xca, 0xcb, 0x03, 0x42, 0x69, 0x31, 0x93, 0x2b, 0x3b, 0x94, 0xb8, 0x3b, 0x90, 0xe6, 0x25, 0x7c, 0x23, 0xc5, 0x24, 0x89, 0x65, 0x37, 0x7b, 0x56, 0x54, 0xa2, 0x23, 0xcb, 0xeb, 0xf0, 0xe9, 0xd1, 0x07, 0x88, 0x36, 0x8f, 0xef, 0x65, 0x71, 0xac, 0x80, 0x5c, 0x81, 0x0a, 0x95, 0x1c, 0xf5, 0xc0, 0x5d, 0xd3, 0xd4, 0x10, 0x0e, 0x4f, 0xcf, 0x87, 0x80, 0xa5, 0xde, 0x6e, 0xff, 0x89, 0x9c, 0xfc, 0x2f, 0x85, 0xf5, 0x93, 0xff, 0x70, 0x8e, 0x48, 0xb6, 0x6e, 0x6e, 0x0a, 0x18, 0xa3, 0xbb, 0x1c, 0x56, 0x60, 0xf1, 0x9d, 0x2a, 0xca, 0xbf, 0xa0, 0x84, 0x73, 0xb1, 0x6d, 0x10, 0x75, 0xcc, 0xa3, 0x20, 0xed, 0x00, 0x52, 0xd0, 0x84, 0x5a, 0xc9, 0xbb, 0x17, 0x84, 0x96, 0x40, 0x48, 0xe2, 0x8e, 0x84, 0x30, 0x82, 0x3b, 0x87, 0xa4, 0x54, 0x55, 0x8c, 0xb5, 0x62, 0x97, 0xd7, 0xf1, 0xa3, 0x8b, 0x44, 0xaa, 0x34, 0xfd, 0xe9, 0xad, 0xda, 0xeb, 0x45, 0x27, 0xfb, 0xad, 0xea, 0x9a, 0x0c, 0x38, 0x30, 0x27, 0x6a, 0x82, 0xc2, 0xc2, 0x0a, 0xa0, 0xed, 0x30, 0x2f, 0x50, 0x9f, 0xdb, 0x1a, 0xfb, 0x29, 0x1c, 0x8a, 0x28, 0x3f, 0xd6, 0xf6, 0xa9, 0xeb, 0x76, 0x60, 0xa2, 0x56, 0xa2, 0x90, 0x32, 0xcd, 0x25, 0x41, 0xb7, 0xc0, 0x9e, 0x13, 0x97, 0xaf }));
|
||||
Assert.IsTrue(m.Signature.SequenceEqual(new byte[] { 0x00, 0x00, 0x00, 0x07, 0x73, 0x73, 0x68, 0x2d, 0x72, 0x73, 0x61, 0x00, 0x00, 0x01, 0x00, 0x0d, 0x67, 0x83, 0xa1, 0xb8, 0x0c, 0x65, 0xb8, 0xd3, 0x76, 0x5f, 0x5f, 0x05, 0x51, 0x8c, 0xb3, 0x2d, 0x1e, 0x95, 0x67, 0xd6, 0xe2, 0xe4, 0x86, 0x49, 0x11, 0xca, 0x83, 0xab, 0xdb, 0x80, 0x75, 0x4e, 0x89, 0xa7, 0x3d, 0xb6, 0xc2, 0x92, 0xbb, 0x40, 0x00, 0xb9, 0xb3, 0x03, 0x86, 0x19, 0x9d, 0x67, 0x29, 0x2b, 0x5a, 0xc9, 0x0a, 0x6c, 0xa3, 0x21, 0xaf, 0xd8, 0xd4, 0xa7, 0x84, 0x6a, 0xe5, 0x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67, 0xb9, 0xac, 0x8a, 0xd1, 0xab, 0xd4, 0x82 }));
|
||||
Assert.IsTrue(m.F.SequenceEqual(new byte[] { 0x00, 0xc6, 0x58, 0xb9, 0xa8, 0x11, 0xfd, 0xb6, 0xd6, 0xe9, 0x0c, 0x51, 0x45, 0xac, 0x51, 0x8a, 0x25, 0x6e, 0x1d, 0x9e, 0xbb, 0x7f, 0x98, 0xe3, 0x94, 0xd5, 0xac, 0x97, 0xd6, 0x35, 0x2e, 0xcc, 0x34, 0x85, 0xe2, 0x29, 0x2c, 0xba, 0x45, 0x6b, 0x39, 0xce, 0xd2, 0xae, 0x2e, 0x9a, 0x30, 0x43, 0x45, 0x09, 0xd2, 0xeb, 0x21, 0x46, 0x95, 0xa8, 0xb9, 0xbc, 0xb4, 0x21, 0xcd, 0x65, 0xeb, 0x0f, 0x48, 0x3c, 0x82, 0xdb, 0x52, 0x0e, 0xa5, 0xa8, 0xca, 0x29, 0x2d, 0xf8, 0x54, 0x38, 0xe4, 0x8f, 0x2c, 0x2d, 0x45, 0x2d, 0x2c, 0xf7, 0x1a, 0x41, 0xef, 0xd4, 0xec, 0x0f, 0xa5, 0xa8, 0xa7, 0x64, 0xb3, 0xe8, 0x7b, 0xa1, 0x40, 0x41, 0x69, 0x70, 0x4d, 0x95, 0x91, 0x8b, 0x5f, 0x28, 0xa2, 0xfc, 0xa7, 0x12, 0x2b, 0x94, 0xf0, 0x0a, 0x82, 0x92, 0x65, 0xdf, 0x8a, 0x35, 0xfb, 0xcc, 0xbe, 0xbd, 0x2d }));
|
||||
CollectionAssert.AreEqual(new byte[] { 0x00, 0x00, 0x00, 0x07, 0x73, 0x73, 0x68, 0x2d, 0x72, 0x73, 0x61, 0x00, 0x00, 0x00, 0x03, 0x01, 0x00, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0xce, 0x38, 0xdf, 0x0d, 0x04, 0x2c, 0x10, 0x45, 0x8f, 0x5e, 0xeb, 0xc2, 0x35, 0x01, 0xd5, 0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, 0x34, 0xfd, 0xe9, 0xad, 0xda, 0xeb, 0x45, 0x27, 0xfb, 0xad, 0xea, 0x9a, 0x0c, 0x38, 0x30, 0x27, 0x6a, 0x82, 0xc2, 0xc2, 0x0a, 0xa0, 0xed, 0x30, 0x2f, 0x50, 0x9f, 0xdb, 0x1a, 0xfb, 0x29, 0x1c, 0x8a, 0x28, 0x3f, 0xd6, 0xf6, 0xa9, 0xeb, 0x76, 0x60, 0xa2, 0x56, 0xa2, 0x90, 0x32, 0xcd, 0x25, 0x41, 0xb7, 0xc0, 0x9e, 0x13, 0x97, 0xaf }, m.HostKey);
|
||||
CollectionAssert.AreEqual(new byte[] { 0x00, 0x00, 0x00, 0x07, 0x73, 0x73, 0x68, 0x2d, 0x72, 0x73, 0x61, 0x00, 0x00, 0x01, 0x00, 0x0d, 0x67, 0x83, 0xa1, 0xb8, 0x0c, 0x65, 0xb8, 0xd3, 0x76, 0x5f, 0x5f, 0x05, 0x51, 0x8c, 0xb3, 0x2d, 0x1e, 0x95, 0x67, 0xd6, 0xe2, 0xe4, 0x86, 0x49, 0x11, 0xca, 0x83, 0xab, 0xdb, 0x80, 0x75, 0x4e, 0x89, 0xa7, 0x3d, 0xb6, 0xc2, 0x92, 0xbb, 0x40, 0x00, 0xb9, 0xb3, 0x03, 0x86, 0x19, 0x9d, 0x67, 0x29, 0x2b, 0x5a, 0xc9, 0x0a, 0x6c, 0xa3, 0x21, 0xaf, 0xd8, 0xd4, 0xa7, 0x84, 0x6a, 0xe5, 0x36, 0x3e, 0xa5, 0x58, 0xd6, 0x36, 0x33, 0x12, 0x2e, 0xf9, 0x22, 0x10, 0xff, 0xae, 0x0e, 0xee, 0xfa, 0xdf, 0x1f, 0xf8, 0x70, 0xfe, 0xc0, 0x30, 0x1d, 0x23, 0xbf, 0x99, 0x20, 0x22, 0x18, 0x78, 0xab, 0x5f, 0xd5, 0xfa, 0x5f, 0xf1, 0x18, 0xc2, 0x20, 0xc5, 0x58, 0x90, 0x63, 0x4b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 0xcc, 0x34, 0x85, 0xe2, 0x29, 0x2c, 0xba, 0x45, 0x6b, 0x39, 0xce, 0xd2, 0xae, 0x2e, 0x9a, 0x30, 0x43, 0x45, 0x09, 0xd2, 0xeb, 0x21, 0x46, 0x95, 0xa8, 0xb9, 0xbc, 0xb4, 0x21, 0xcd, 0x65, 0xeb, 0x0f, 0x48, 0x3c, 0x82, 0xdb, 0x52, 0x0e, 0xa5, 0xa8, 0xca, 0x29, 0x2d, 0xf8, 0x54, 0x38, 0xe4, 0x8f, 0x2c, 0x2d, 0x45, 0x2d, 0x2c, 0xf7, 0x1a, 0x41, 0xef, 0xd4, 0xec, 0x0f, 0xa5, 0xa8, 0xa7, 0x64, 0xb3, 0xe8, 0x7b, 0xa1, 0x40, 0x41, 0x69, 0x70, 0x4d, 0x95, 0x91, 0x8b, 0x5f, 0x28, 0xa2, 0xfc, 0xa7, 0x12, 0x2b, 0x94, 0xf0, 0x0a, 0x82, 0x92, 0x65, 0xdf, 0x8a, 0x35, 0xfb, 0xcc, 0xbe, 0xbd, 0x2d }, m.F);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,16 +25,16 @@ namespace Renci.SshNet.Tests.Classes.Messages.Transport
|
||||
|
||||
Assert.IsFalse(m.FirstKexPacketFollows);
|
||||
Assert.AreEqual(0u, m.Reserved);
|
||||
Assert.IsTrue(m.CompressionAlgorithmsClientToServer.SequenceEqual(new[] { "none", "zlib@openssh.com" }));
|
||||
Assert.IsTrue(m.CompressionAlgorithmsServerToClient.SequenceEqual(new[] { "none", "zlib@openssh.com" }));
|
||||
Assert.IsTrue(m.EncryptionAlgorithmsClientToServer.SequenceEqual(new[] { "aes128-ctr", "aes192-ctr", "aes256-ctr", "arcfour256", "arcfour128", "aes128-cbc", "3des-cbc", "blowfish-cbc", "cast128-cbc", "aes192-cbc", "aes256-cbc", "arcfour", "rijndael-cbc@lysator.liu.se" }));
|
||||
Assert.IsTrue(m.EncryptionAlgorithmsServerToClient.SequenceEqual(new[] { "aes128-ctr", "aes192-ctr", "aes256-ctr", "arcfour256", "arcfour128", "aes128-cbc", "3des-cbc", "blowfish-cbc", "cast128-cbc", "aes192-cbc", "aes256-cbc", "arcfour", "rijndael-cbc@lysator.liu.se" }));
|
||||
Assert.IsTrue(m.KeyExchangeAlgorithms.SequenceEqual(new[] { "ecdh-sha2-nistp256", "ecdh-sha2-nistp384", "ecdh-sha2-nistp521", "diffie-hellman-group-exchange-sha256", "diffie-hellman-group-exchange-sha1", "diffie-hellman-group14-sha1", "diffie-hellman-group1-sha1" }));
|
||||
Assert.IsTrue(m.LanguagesClientToServer.SequenceEqual(new[] { "" }));
|
||||
Assert.IsTrue(m.LanguagesServerToClient.SequenceEqual(new[] { "" }));
|
||||
Assert.IsTrue(m.MacAlgorithmsClientToServer.SequenceEqual(new[] { "hmac-md5", "hmac-sha1", "umac-64@openssh.com", "hmac-sha2-256", "hmac-sha2-256-96", "hmac-sha2-512", "hmac-sha2-512-96", "hmac-ripemd160", "hmac-ripemd160@openssh.com", "hmac-sha1-96", "hmac-md5-96" }));
|
||||
Assert.IsTrue(m.MacAlgorithmsServerToClient.SequenceEqual(new[] { "hmac-md5", "hmac-sha1", "umac-64@openssh.com", "hmac-sha2-256", "hmac-sha2-256-96", "hmac-sha2-512", "hmac-sha2-512-96", "hmac-ripemd160", "hmac-ripemd160@openssh.com", "hmac-sha1-96", "hmac-md5-96" }));
|
||||
Assert.IsTrue(m.ServerHostKeyAlgorithms.SequenceEqual(new[] { "ssh-rsa", "ssh-dss", "ecdsa-sha2-nistp256" }));
|
||||
CollectionAssert.AreEqual(new[] { "none", "zlib@openssh.com" }, m.CompressionAlgorithmsClientToServer);
|
||||
CollectionAssert.AreEqual(new[] { "none", "zlib@openssh.com" }, m.CompressionAlgorithmsServerToClient);
|
||||
CollectionAssert.AreEqual(new[] { "aes128-ctr", "aes192-ctr", "aes256-ctr", "arcfour256", "arcfour128", "aes128-cbc", "3des-cbc", "blowfish-cbc", "cast128-cbc", "aes192-cbc", "aes256-cbc", "arcfour", "rijndael-cbc@lysator.liu.se" }, m.EncryptionAlgorithmsClientToServer);
|
||||
CollectionAssert.AreEqual(new[] { "aes128-ctr", "aes192-ctr", "aes256-ctr", "arcfour256", "arcfour128", "aes128-cbc", "3des-cbc", "blowfish-cbc", "cast128-cbc", "aes192-cbc", "aes256-cbc", "arcfour", "rijndael-cbc@lysator.liu.se" }, m.EncryptionAlgorithmsServerToClient);
|
||||
CollectionAssert.AreEqual(new[] { "ecdh-sha2-nistp256", "ecdh-sha2-nistp384", "ecdh-sha2-nistp521", "diffie-hellman-group-exchange-sha256", "diffie-hellman-group-exchange-sha1", "diffie-hellman-group14-sha1", "diffie-hellman-group1-sha1" }, m.KeyExchangeAlgorithms);
|
||||
CollectionAssert.AreEqual(new[] { "" }, m.LanguagesClientToServer);
|
||||
CollectionAssert.AreEqual(new[] { "" }, m.LanguagesServerToClient);
|
||||
CollectionAssert.AreEqual(new[] { "hmac-md5", "hmac-sha1", "umac-64@openssh.com", "hmac-sha2-256", "hmac-sha2-256-96", "hmac-sha2-512", "hmac-sha2-512-96", "hmac-ripemd160", "hmac-ripemd160@openssh.com", "hmac-sha1-96", "hmac-md5-96" }, m.MacAlgorithmsClientToServer);
|
||||
CollectionAssert.AreEqual(new[] { "hmac-md5", "hmac-sha1", "umac-64@openssh.com", "hmac-sha2-256", "hmac-sha2-256-96", "hmac-sha2-512", "hmac-sha2-512-96", "hmac-ripemd160", "hmac-ripemd160@openssh.com", "hmac-sha1-96", "hmac-md5-96" }, m.MacAlgorithmsServerToClient);
|
||||
CollectionAssert.AreEqual(new[] { "ssh-rsa", "ssh-dss", "ecdsa-sha2-nistp256" }, m.ServerHostKeyAlgorithms);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
@@ -63,7 +63,7 @@ namespace Renci.SshNet.Tests.Classes.Messages.Transport
|
||||
var output = m.GetBytes();
|
||||
|
||||
// Skip first 17 bytes since 16 bytes are randomly generated
|
||||
Assert.IsTrue(input.Skip(17).SequenceEqual(output.Skip(17)));
|
||||
CollectionAssert.AreEqual(input.Skip(17).ToArray(), output.Skip(17).ToArray());
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@ using System.Text;
|
||||
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
using Renci.SshNet.Common;
|
||||
using Renci.SshNet.Tests.Common;
|
||||
|
||||
namespace Renci.SshNet.Tests.Classes
|
||||
@@ -82,7 +81,7 @@ namespace Renci.SshNet.Tests.Classes
|
||||
var passwordAuthentication = passwordConnectionInfo.AuthenticationMethods[0] as PasswordAuthenticationMethod;
|
||||
Assert.IsNotNull(passwordAuthentication);
|
||||
Assert.AreEqual(userName, passwordAuthentication.Username);
|
||||
Assert.IsTrue(Encoding.UTF8.GetBytes(password).IsEqualTo(passwordAuthentication.Password));
|
||||
CollectionAssert.AreEqual(Encoding.UTF8.GetBytes(password), passwordAuthentication.Password);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
@@ -112,7 +111,7 @@ namespace Renci.SshNet.Tests.Classes
|
||||
var passwordAuthentication = passwordConnectionInfo.AuthenticationMethods[0] as PasswordAuthenticationMethod;
|
||||
Assert.IsNotNull(passwordAuthentication);
|
||||
Assert.AreEqual(userName, passwordAuthentication.Username);
|
||||
Assert.IsTrue(Encoding.UTF8.GetBytes(password).IsEqualTo(passwordAuthentication.Password));
|
||||
CollectionAssert.AreEqual(Encoding.UTF8.GetBytes(password), passwordAuthentication.Password);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
@@ -33,7 +32,7 @@ namespace Renci.SshNet.Tests.Classes.Security.Cryptography
|
||||
|
||||
var actual = blockCipher.Encrypt(input);
|
||||
|
||||
Assert.IsTrue(output.SequenceEqual(actual));
|
||||
CollectionAssert.AreEqual(output, actual);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
@@ -54,7 +53,7 @@ namespace Renci.SshNet.Tests.Classes.Security.Cryptography
|
||||
|
||||
var actual = blockCipher.Encrypt(input);
|
||||
|
||||
Assert.IsTrue(output.SequenceEqual(actual));
|
||||
CollectionAssert.AreEqual(output, actual);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
@@ -75,7 +74,7 @@ namespace Renci.SshNet.Tests.Classes.Security.Cryptography
|
||||
|
||||
var actual = blockCipher.Encrypt(input);
|
||||
|
||||
Assert.IsTrue(output.SequenceEqual(actual));
|
||||
CollectionAssert.AreEqual(output, actual);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
@@ -98,7 +97,7 @@ namespace Renci.SshNet.Tests.Classes.Security.Cryptography
|
||||
|
||||
var actual = blockCipher.Decrypt(input);
|
||||
|
||||
Assert.IsTrue(output.SequenceEqual(actual));
|
||||
CollectionAssert.AreEqual(output, actual);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
@@ -119,7 +118,7 @@ namespace Renci.SshNet.Tests.Classes.Security.Cryptography
|
||||
|
||||
var actual = blockCipher.Decrypt(input);
|
||||
|
||||
Assert.IsTrue(output.SequenceEqual(actual));
|
||||
CollectionAssert.AreEqual(output, actual);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -138,7 +138,7 @@ namespace Renci.SshNet.Tests.Classes.Security.Cryptography.Ciphers
|
||||
|
||||
var actual = testCipher.Encrypt(input, 2, input.Length - 5);
|
||||
|
||||
Assert.IsTrue(actual.IsEqualTo(expected));
|
||||
CollectionAssert.AreEqual(expected, actual);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
@@ -152,7 +152,7 @@ namespace Renci.SshNet.Tests.Classes.Security.Cryptography.Ciphers
|
||||
|
||||
var actual = testCipher.Encrypt(input);
|
||||
|
||||
Assert.IsTrue(actual.IsEqualTo(expected));
|
||||
CollectionAssert.AreEqual(expected, actual);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
@@ -166,7 +166,7 @@ namespace Renci.SshNet.Tests.Classes.Security.Cryptography.Ciphers
|
||||
|
||||
var actual = testCipher.Decrypt(input);
|
||||
|
||||
Assert.IsTrue(expected.IsEqualTo(actual));
|
||||
CollectionAssert.AreEqual(expected, actual);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
@@ -180,7 +180,7 @@ namespace Renci.SshNet.Tests.Classes.Security.Cryptography.Ciphers
|
||||
|
||||
var actual = testCipher.Decrypt(input, 1, input.Length - 3);
|
||||
|
||||
Assert.IsTrue(expected.IsEqualTo(actual));
|
||||
CollectionAssert.AreEqual(expected, actual);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
|
||||
+2
-3
@@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
@@ -111,13 +110,13 @@ namespace Renci.SshNet.Tests.Classes.Sftp.Requests.ExtendedRequests
|
||||
|
||||
var actualNameBytes = new byte[_nameBytes.Length];
|
||||
_ = sshDataStream.Read(actualNameBytes, 0, actualNameBytes.Length);
|
||||
Assert.IsTrue(_nameBytes.SequenceEqual(actualNameBytes));
|
||||
CollectionAssert.AreEqual(_nameBytes, actualNameBytes);
|
||||
|
||||
Assert.AreEqual((uint)_handle.Length, sshDataStream.ReadUInt32());
|
||||
|
||||
var actualHandle = new byte[_handle.Length];
|
||||
_ = sshDataStream.Read(actualHandle, 0, actualHandle.Length);
|
||||
Assert.IsTrue(_handle.SequenceEqual(actualHandle));
|
||||
CollectionAssert.AreEqual(_handle, actualHandle);
|
||||
|
||||
Assert.IsTrue(sshDataStream.IsEndOfData);
|
||||
}
|
||||
|
||||
+3
-4
@@ -1,7 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
@@ -98,19 +97,19 @@ namespace Renci.SshNet.Tests.Classes.Sftp.Requests.ExtendedRequests
|
||||
|
||||
var actualNameBytes = new byte[_nameBytes.Length];
|
||||
_ = sshDataStream.Read(actualNameBytes, 0, actualNameBytes.Length);
|
||||
Assert.IsTrue(_nameBytes.SequenceEqual(actualNameBytes));
|
||||
CollectionAssert.AreEqual(_nameBytes, actualNameBytes);
|
||||
|
||||
Assert.AreEqual((uint)_oldPathBytes.Length, sshDataStream.ReadUInt32());
|
||||
|
||||
var actualOldPath = new byte[_oldPathBytes.Length];
|
||||
_ = sshDataStream.Read(actualOldPath, 0, actualOldPath.Length);
|
||||
Assert.IsTrue(_oldPathBytes.SequenceEqual(actualOldPath));
|
||||
CollectionAssert.AreEqual(_oldPathBytes, actualOldPath);
|
||||
|
||||
Assert.AreEqual((uint)_newPathBytes.Length, sshDataStream.ReadUInt32());
|
||||
|
||||
var actualNewPath = new byte[_newPathBytes.Length];
|
||||
_ = sshDataStream.Read(actualNewPath, 0, actualNewPath.Length);
|
||||
Assert.IsTrue(_newPathBytes.SequenceEqual(actualNewPath));
|
||||
CollectionAssert.AreEqual(_newPathBytes, actualNewPath);
|
||||
|
||||
Assert.IsTrue(sshDataStream.IsEndOfData);
|
||||
}
|
||||
|
||||
+3
-4
@@ -1,7 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
@@ -102,19 +101,19 @@ namespace Renci.SshNet.Tests.Classes.Sftp.Requests.ExtendedRequests
|
||||
|
||||
var actualNameBytes = new byte[_nameBytes.Length];
|
||||
_ = sshDataStream.Read(actualNameBytes, 0, actualNameBytes.Length);
|
||||
Assert.IsTrue(_nameBytes.SequenceEqual(actualNameBytes));
|
||||
CollectionAssert.AreEqual(_nameBytes, actualNameBytes);
|
||||
|
||||
Assert.AreEqual((uint)_oldPathBytes.Length, sshDataStream.ReadUInt32());
|
||||
|
||||
var actualOldPath = new byte[_oldPathBytes.Length];
|
||||
_ = sshDataStream.Read(actualOldPath, 0, actualOldPath.Length);
|
||||
Assert.IsTrue(_oldPathBytes.SequenceEqual(actualOldPath));
|
||||
CollectionAssert.AreEqual(_oldPathBytes, actualOldPath);
|
||||
|
||||
Assert.AreEqual((uint)_newPathBytes.Length, sshDataStream.ReadUInt32());
|
||||
|
||||
var actualNewPath = new byte[_newPathBytes.Length];
|
||||
_ = sshDataStream.Read(actualNewPath, 0, actualNewPath.Length);
|
||||
Assert.IsTrue(_newPathBytes.SequenceEqual(actualNewPath));
|
||||
CollectionAssert.AreEqual(_newPathBytes, actualNewPath);
|
||||
|
||||
Assert.IsTrue(sshDataStream.IsEndOfData);
|
||||
}
|
||||
|
||||
+2
-3
@@ -1,7 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
@@ -117,13 +116,13 @@ namespace Renci.SshNet.Tests.Classes.Sftp.Requests.ExtendedRequests
|
||||
|
||||
var actualNameBytes = new byte[_nameBytes.Length];
|
||||
_ = sshDataStream.Read(actualNameBytes, 0, actualNameBytes.Length);
|
||||
Assert.IsTrue(_nameBytes.SequenceEqual(actualNameBytes));
|
||||
CollectionAssert.AreEqual(_nameBytes, actualNameBytes);
|
||||
|
||||
Assert.AreEqual((uint)_pathBytes.Length, sshDataStream.ReadUInt32());
|
||||
|
||||
var actualPath = new byte[_pathBytes.Length];
|
||||
_ = sshDataStream.Read(actualPath, 0, actualPath.Length);
|
||||
Assert.IsTrue(_pathBytes.SequenceEqual(actualPath));
|
||||
CollectionAssert.AreEqual(_pathBytes, actualPath);
|
||||
|
||||
Assert.IsTrue(sshDataStream.IsEndOfData);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
@@ -93,7 +92,7 @@ namespace Renci.SshNet.Tests.Classes.Sftp.Requests
|
||||
Assert.AreEqual((uint)_handle.Length, sshDataStream.ReadUInt32());
|
||||
var actualHandle = new byte[_handle.Length];
|
||||
_ = sshDataStream.Read(actualHandle, 0, actualHandle.Length);
|
||||
Assert.IsTrue(_handle.SequenceEqual(actualHandle));
|
||||
CollectionAssert.AreEqual(_handle, actualHandle);
|
||||
|
||||
Assert.AreEqual(_offset, sshDataStream.ReadUInt64());
|
||||
Assert.AreEqual(_length, sshDataStream.ReadUInt64());
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
@@ -81,7 +80,7 @@ namespace Renci.SshNet.Tests.Classes.Sftp.Requests
|
||||
Assert.AreEqual((uint)_handle.Length, sshDataStream.ReadUInt32());
|
||||
var actualHandle = new byte[_handle.Length];
|
||||
_ = sshDataStream.Read(actualHandle, 0, actualHandle.Length);
|
||||
Assert.IsTrue(_handle.SequenceEqual(actualHandle));
|
||||
CollectionAssert.AreEqual(_handle, actualHandle);
|
||||
|
||||
Assert.IsTrue(sshDataStream.IsEndOfData);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
@@ -87,11 +86,11 @@ namespace Renci.SshNet.Tests.Classes.Sftp.Requests
|
||||
Assert.AreEqual((uint)_handle.Length, sshDataStream.ReadUInt32());
|
||||
var actualHandle = new byte[_handle.Length];
|
||||
_ = sshDataStream.Read(actualHandle, 0, actualHandle.Length);
|
||||
Assert.IsTrue(_handle.SequenceEqual(actualHandle));
|
||||
CollectionAssert.AreEqual(_handle, actualHandle);
|
||||
|
||||
var actualAttributes = new byte[_attributesBytes.Length];
|
||||
_ = sshDataStream.Read(actualAttributes, 0, actualAttributes.Length);
|
||||
Assert.IsTrue(_attributesBytes.SequenceEqual(actualAttributes));
|
||||
CollectionAssert.AreEqual(_attributesBytes, actualAttributes);
|
||||
|
||||
Assert.IsTrue(sshDataStream.IsEndOfData);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
@@ -103,7 +102,7 @@ namespace Renci.SshNet.Tests.Classes.Sftp.Requests
|
||||
Assert.AreEqual((uint)_handle.Length, sshDataStream.ReadUInt32());
|
||||
var actualHandle = new byte[_handle.Length];
|
||||
_ = sshDataStream.Read(actualHandle, 0, actualHandle.Length);
|
||||
Assert.IsTrue(_handle.SequenceEqual(actualHandle));
|
||||
CollectionAssert.AreEqual(_handle, actualHandle);
|
||||
|
||||
Assert.IsTrue(sshDataStream.IsEndOfData);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
@@ -109,7 +108,7 @@ namespace Renci.SshNet.Tests.Classes.Sftp.Requests
|
||||
Assert.AreEqual((uint)_pathBytes.Length, sshDataStream.ReadUInt32());
|
||||
var actualPath = new byte[_pathBytes.Length];
|
||||
_ = sshDataStream.Read(actualPath, 0, actualPath.Length);
|
||||
Assert.IsTrue(_pathBytes.SequenceEqual(actualPath));
|
||||
CollectionAssert.AreEqual(_pathBytes, actualPath);
|
||||
|
||||
Assert.IsTrue(sshDataStream.IsEndOfData);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
@@ -97,12 +96,12 @@ namespace Renci.SshNet.Tests.Classes.Sftp.Requests
|
||||
Assert.AreEqual((uint)_newLinkPathBytes.Length, sshDataStream.ReadUInt32());
|
||||
var actualNewLinkPath = new byte[_newLinkPathBytes.Length];
|
||||
_ = sshDataStream.Read(actualNewLinkPath, 0, actualNewLinkPath.Length);
|
||||
Assert.IsTrue(_newLinkPathBytes.SequenceEqual(actualNewLinkPath));
|
||||
CollectionAssert.AreEqual(_newLinkPathBytes, actualNewLinkPath);
|
||||
|
||||
Assert.AreEqual((uint)_existingPathBytes.Length, sshDataStream.ReadUInt32());
|
||||
var actualExistingPath = new byte[_existingPathBytes.Length];
|
||||
_ = sshDataStream.Read(actualExistingPath, 0, actualExistingPath.Length);
|
||||
Assert.IsTrue(_existingPathBytes.SequenceEqual(actualExistingPath));
|
||||
CollectionAssert.AreEqual(_existingPathBytes, actualExistingPath);
|
||||
|
||||
Assert.AreEqual(1, sshDataStream.ReadByte());
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
@@ -93,11 +92,11 @@ namespace Renci.SshNet.Tests.Classes.Sftp.Requests
|
||||
Assert.AreEqual((uint)_pathBytes.Length, sshDataStream.ReadUInt32());
|
||||
var actualPath = new byte[_pathBytes.Length];
|
||||
_ = sshDataStream.Read(actualPath, 0, actualPath.Length);
|
||||
Assert.IsTrue(_pathBytes.SequenceEqual(actualPath));
|
||||
CollectionAssert.AreEqual(_pathBytes, actualPath);
|
||||
|
||||
var actualAttributes = new byte[_attributesBytes.Length];
|
||||
_ = sshDataStream.Read(actualAttributes, 0, actualAttributes.Length);
|
||||
Assert.IsTrue(_attributesBytes.SequenceEqual(actualAttributes));
|
||||
CollectionAssert.AreEqual(_attributesBytes, actualAttributes);
|
||||
|
||||
Assert.IsTrue(sshDataStream.IsEndOfData);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
@@ -109,7 +108,7 @@ namespace Renci.SshNet.Tests.Classes.Sftp.Requests
|
||||
Assert.AreEqual((uint)_pathBytes.Length, sshDataStream.ReadUInt32());
|
||||
var actualPath = new byte[_pathBytes.Length];
|
||||
_ = sshDataStream.Read(actualPath, 0, actualPath.Length);
|
||||
Assert.IsTrue(_pathBytes.SequenceEqual(actualPath));
|
||||
CollectionAssert.AreEqual(_pathBytes, actualPath);
|
||||
|
||||
Assert.IsTrue(sshDataStream.IsEndOfData);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
@@ -132,13 +131,13 @@ namespace Renci.SshNet.Tests.Classes.Sftp.Requests
|
||||
Assert.AreEqual((uint)_filenameBytes.Length, sshDataStream.ReadUInt32());
|
||||
var actualPath = new byte[_filenameBytes.Length];
|
||||
_ = sshDataStream.Read(actualPath, 0, actualPath.Length);
|
||||
Assert.IsTrue(_filenameBytes.SequenceEqual(actualPath));
|
||||
CollectionAssert.AreEqual(_filenameBytes, actualPath);
|
||||
|
||||
Assert.AreEqual((uint)_flags, sshDataStream.ReadUInt32());
|
||||
|
||||
var actualAttributes = new byte[_attributesBytes.Length];
|
||||
_ = sshDataStream.Read(actualAttributes, 0, actualAttributes.Length);
|
||||
Assert.IsTrue(_attributesBytes.SequenceEqual(actualAttributes));
|
||||
CollectionAssert.AreEqual(_attributesBytes, actualAttributes);
|
||||
|
||||
Assert.IsTrue(sshDataStream.IsEndOfData);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
@@ -104,7 +103,7 @@ namespace Renci.SshNet.Tests.Classes.Sftp.Requests
|
||||
Assert.AreEqual((uint)_handle.Length, sshDataStream.ReadUInt32());
|
||||
var actualHandle = new byte[_handle.Length];
|
||||
_ = sshDataStream.Read(actualHandle, 0, actualHandle.Length);
|
||||
Assert.IsTrue(_handle.SequenceEqual(actualHandle));
|
||||
CollectionAssert.AreEqual(_handle, actualHandle);
|
||||
|
||||
Assert.IsTrue(sshDataStream.IsEndOfData);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
@@ -121,7 +120,7 @@ namespace Renci.SshNet.Tests.Classes.Sftp.Requests
|
||||
Assert.AreEqual((uint)_pathBytes.Length, sshDataStream.ReadUInt32());
|
||||
var actualPath = new byte[_pathBytes.Length];
|
||||
_ = sshDataStream.Read(actualPath, 0, actualPath.Length);
|
||||
Assert.IsTrue(_pathBytes.SequenceEqual(actualPath));
|
||||
CollectionAssert.AreEqual(_pathBytes, actualPath);
|
||||
|
||||
Assert.IsTrue(sshDataStream.IsEndOfData);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
@@ -125,7 +124,7 @@ namespace Renci.SshNet.Tests.Classes.Sftp.Requests
|
||||
Assert.AreEqual((uint)_handle.Length, sshDataStream.ReadUInt32());
|
||||
var actualHandle = new byte[_handle.Length];
|
||||
_ = sshDataStream.Read(actualHandle, 0, actualHandle.Length);
|
||||
Assert.IsTrue(_handle.SequenceEqual(actualHandle));
|
||||
CollectionAssert.AreEqual(_handle, actualHandle);
|
||||
|
||||
Assert.AreEqual(_offset, sshDataStream.ReadUInt64());
|
||||
Assert.AreEqual(_length, sshDataStream.ReadUInt32());
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
@@ -137,7 +136,7 @@ namespace Renci.SshNet.Tests.Classes.Sftp.Requests
|
||||
Assert.AreEqual((uint)_pathBytes.Length, sshDataStream.ReadUInt32());
|
||||
var actualPath = new byte[_pathBytes.Length];
|
||||
_ = sshDataStream.Read(actualPath, 0, actualPath.Length);
|
||||
Assert.IsTrue(_pathBytes.SequenceEqual(actualPath));
|
||||
CollectionAssert.AreEqual(_pathBytes, actualPath);
|
||||
|
||||
Assert.IsTrue(sshDataStream.IsEndOfData);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
@@ -87,7 +86,7 @@ namespace Renci.SshNet.Tests.Classes.Sftp.Requests
|
||||
Assert.AreEqual((uint)_filenameBytes.Length, sshDataStream.ReadUInt32());
|
||||
var actualFilename = new byte[_filenameBytes.Length];
|
||||
_ = sshDataStream.Read(actualFilename, 0, actualFilename.Length);
|
||||
Assert.IsTrue(_filenameBytes.SequenceEqual(actualFilename));
|
||||
CollectionAssert.AreEqual(_filenameBytes, actualFilename);
|
||||
|
||||
Assert.IsTrue(sshDataStream.IsEndOfData);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
@@ -94,12 +93,12 @@ namespace Renci.SshNet.Tests.Classes.Sftp.Requests
|
||||
Assert.AreEqual((uint)_oldPathBytes.Length, sshDataStream.ReadUInt32());
|
||||
var actualOldPath = new byte[_oldPathBytes.Length];
|
||||
_ = sshDataStream.Read(actualOldPath, 0, actualOldPath.Length);
|
||||
Assert.IsTrue(_oldPathBytes.SequenceEqual(actualOldPath));
|
||||
CollectionAssert.AreEqual(_oldPathBytes, actualOldPath);
|
||||
|
||||
Assert.AreEqual((uint)_newPathBytes.Length, sshDataStream.ReadUInt32());
|
||||
var actualNewPath = new byte[_newPathBytes.Length];
|
||||
_ = sshDataStream.Read(actualNewPath, 0, actualNewPath.Length);
|
||||
Assert.IsTrue(_newPathBytes.SequenceEqual(actualNewPath));
|
||||
CollectionAssert.AreEqual(_newPathBytes, actualNewPath);
|
||||
|
||||
Assert.IsTrue(sshDataStream.IsEndOfData);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
@@ -89,7 +88,7 @@ namespace Renci.SshNet.Tests.Classes.Sftp.Requests
|
||||
Assert.AreEqual((uint)_pathBytes.Length, sshDataStream.ReadUInt32());
|
||||
var actualPath = new byte[_pathBytes.Length];
|
||||
_ = sshDataStream.Read(actualPath, 0, actualPath.Length);
|
||||
Assert.IsTrue(_pathBytes.SequenceEqual(actualPath));
|
||||
CollectionAssert.AreEqual(_pathBytes, actualPath);
|
||||
|
||||
Assert.IsTrue(sshDataStream.IsEndOfData);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
@@ -98,11 +97,11 @@ namespace Renci.SshNet.Tests.Classes.Sftp.Requests
|
||||
Assert.AreEqual((uint)_pathBytes.Length, sshDataStream.ReadUInt32());
|
||||
var actualPath = new byte[_pathBytes.Length];
|
||||
_ = sshDataStream.Read(actualPath, 0, actualPath.Length);
|
||||
Assert.IsTrue(_pathBytes.SequenceEqual(actualPath));
|
||||
CollectionAssert.AreEqual(_pathBytes, actualPath);
|
||||
|
||||
var actualAttributes = new byte[_attributesBytes.Length];
|
||||
_ = sshDataStream.Read(actualAttributes, 0, actualAttributes.Length);
|
||||
Assert.IsTrue(_attributesBytes.SequenceEqual(actualAttributes));
|
||||
CollectionAssert.AreEqual(_attributesBytes, actualAttributes);
|
||||
|
||||
Assert.IsTrue(sshDataStream.IsEndOfData);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
@@ -107,7 +106,7 @@ namespace Renci.SshNet.Tests.Classes.Sftp.Requests
|
||||
Assert.AreEqual((uint)_pathBytes.Length, sshDataStream.ReadUInt32());
|
||||
var actualPath = new byte[_pathBytes.Length];
|
||||
_ = sshDataStream.Read(actualPath, 0, actualPath.Length);
|
||||
Assert.IsTrue(_pathBytes.SequenceEqual(actualPath));
|
||||
CollectionAssert.AreEqual(_pathBytes, actualPath);
|
||||
|
||||
Assert.IsTrue(sshDataStream.IsEndOfData);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
@@ -112,12 +111,12 @@ namespace Renci.SshNet.Tests.Classes.Sftp.Requests
|
||||
Assert.AreEqual((uint)_newLinkPathBytes.Length, sshDataStream.ReadUInt32());
|
||||
var actualNewLinkPath = new byte[_newLinkPathBytes.Length];
|
||||
_ = sshDataStream.Read(actualNewLinkPath, 0, actualNewLinkPath.Length);
|
||||
Assert.IsTrue(_newLinkPathBytes.SequenceEqual(actualNewLinkPath));
|
||||
CollectionAssert.AreEqual(_newLinkPathBytes, actualNewLinkPath);
|
||||
|
||||
Assert.AreEqual((uint)_existingPathBytes.Length, sshDataStream.ReadUInt32());
|
||||
var actualExistingPath = new byte[_existingPathBytes.Length];
|
||||
_ = sshDataStream.Read(actualExistingPath, 0, actualExistingPath.Length);
|
||||
Assert.IsTrue(_existingPathBytes.SequenceEqual(actualExistingPath));
|
||||
CollectionAssert.AreEqual(_existingPathBytes, actualExistingPath);
|
||||
|
||||
Assert.IsTrue(sshDataStream.IsEndOfData);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
@@ -86,7 +85,7 @@ namespace Renci.SshNet.Tests.Classes.Sftp.Requests
|
||||
Assert.AreEqual((uint)_handle.Length, sshDataStream.ReadUInt32());
|
||||
var actualHandle = new byte[_handle.Length];
|
||||
_ = sshDataStream.Read(actualHandle, 0, actualHandle.Length);
|
||||
Assert.IsTrue(_handle.SequenceEqual(actualHandle));
|
||||
CollectionAssert.AreEqual(_handle, actualHandle);
|
||||
|
||||
Assert.AreEqual(_offset, sshDataStream.ReadUInt64());
|
||||
Assert.AreEqual(_length, sshDataStream.ReadUInt64());
|
||||
|
||||
@@ -104,14 +104,14 @@ namespace Renci.SshNet.Tests.Classes.Sftp.Requests
|
||||
Assert.AreEqual((uint)_handle.Length, sshDataStream.ReadUInt32());
|
||||
var actualHandle = new byte[_handle.Length];
|
||||
_ = sshDataStream.Read(actualHandle, 0, actualHandle.Length);
|
||||
Assert.IsTrue(_handle.SequenceEqual(actualHandle));
|
||||
CollectionAssert.AreEqual(_handle, actualHandle);
|
||||
|
||||
Assert.AreEqual(_serverFileOffset, sshDataStream.ReadUInt64());
|
||||
|
||||
Assert.AreEqual((uint)_length, sshDataStream.ReadUInt32());
|
||||
var actualData = new byte[_length];
|
||||
_ = sshDataStream.Read(actualData, 0, actualData.Length);
|
||||
Assert.IsTrue(_data.Take(_offset, _length).SequenceEqual(actualData));
|
||||
CollectionAssert.AreEqual(_data.Take(_offset, _length), actualData);
|
||||
|
||||
Assert.IsTrue(sshDataStream.IsEndOfData);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
@@ -52,7 +51,7 @@ namespace Renci.SshNet.Tests.Classes.Sftp.Responses
|
||||
|
||||
target.Load(sshData);
|
||||
|
||||
Assert.IsTrue(target.Data.SequenceEqual(_data));
|
||||
CollectionAssert.AreEqual(_data, target.Data.ToArray());
|
||||
Assert.AreEqual(_protocolVersion, target.ProtocolVersion);
|
||||
Assert.AreEqual(_responseId, target.ResponseId);
|
||||
Assert.AreEqual(SftpMessageTypes.Data, target.SftpMessageType);
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
@@ -51,7 +50,7 @@ namespace Renci.SshNet.Tests.Classes.Sftp.Responses
|
||||
target.Load(sshDataStream.ToArray());
|
||||
|
||||
Assert.IsNotNull(target.Handle);
|
||||
Assert.IsTrue(target.Handle.SequenceEqual(_handle));
|
||||
CollectionAssert.AreEqual(_handle, target.Handle);
|
||||
Assert.AreEqual(_protocolVersion, target.ProtocolVersion);
|
||||
Assert.AreEqual(_responseId, target.ResponseId);
|
||||
Assert.AreEqual(SftpMessageTypes.Handle, target.SftpMessageType);
|
||||
|
||||
@@ -163,7 +163,7 @@ namespace Renci.SshNet.Tests.Classes.Sftp
|
||||
public void ReturnedValueShouldBeDataOfSftpDataResponse()
|
||||
{
|
||||
Assert.IsNotNull(_actual);
|
||||
Assert.IsTrue(_data.SequenceEqual(_actual));
|
||||
CollectionAssert.AreEqual(_data, _actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -200,13 +200,13 @@ namespace Renci.SshNet.Tests.Classes.Sftp
|
||||
[TestMethod]
|
||||
public void ReturnedValueShouldBeDataOfSftpDataResponse()
|
||||
{
|
||||
Assert.IsTrue(_data.IsEqualTo(_actualData));
|
||||
CollectionAssert.AreEqual(_data, _actualData);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void ReturnedHandleShouldBeHandleOfSftpHandleResponse()
|
||||
{
|
||||
Assert.IsTrue(_handle.IsEqualTo(_actualHandle));
|
||||
CollectionAssert.AreEqual(_handle, _actualHandle);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -198,13 +198,13 @@ namespace Renci.SshNet.Tests.Classes.Sftp
|
||||
[TestMethod]
|
||||
public void ReturnedValueShouldBeDataOfSftpDataResponse()
|
||||
{
|
||||
Assert.IsTrue(_data.IsEqualTo(_actualData));
|
||||
CollectionAssert.AreEqual(_data, _actualData);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void ReturnedHandleShouldBeHandleOfSftpHandleResponse()
|
||||
{
|
||||
Assert.IsTrue(_handle.IsEqualTo(_actualHandle));
|
||||
CollectionAssert.AreEqual(_handle, _actualHandle);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -165,7 +165,7 @@ namespace Renci.SshNet.Tests.Classes.Sftp
|
||||
[TestMethod]
|
||||
public void ReturnedValueShouldBeDataOfSftpDataResponse()
|
||||
{
|
||||
Assert.IsTrue(_data.IsEqualTo(_actual));
|
||||
CollectionAssert.AreEqual(_data, _actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -130,7 +130,7 @@ namespace Renci.SshNet.Tests.Classes
|
||||
_shellStream.Flush();
|
||||
|
||||
Assert.IsNotNull(bytesSent);
|
||||
Assert.IsTrue(_data.Take(_offset, _count).IsEqualTo(bytesSent));
|
||||
CollectionAssert.AreEqual(_data.Take(_offset, _count), bytesSent);
|
||||
|
||||
_channelSessionMock.Verify(p => p.SendData(It.IsAny<byte[]>(), It.IsAny<int>(), It.IsAny<int>()), Times.Once);
|
||||
}
|
||||
|
||||
+2
-2
@@ -137,8 +137,8 @@ namespace Renci.SshNet.Tests.Classes
|
||||
|
||||
Assert.IsNotNull(bytesSent);
|
||||
Assert.HasCount(_bufferData.Length + _count, bytesSent);
|
||||
Assert.IsTrue(_bufferData.IsEqualTo(bytesSent.Take(_bufferData.Length)));
|
||||
Assert.IsTrue(_data.Take(0, _count).IsEqualTo(bytesSent.Take(_bufferData.Length, _count)));
|
||||
CollectionAssert.AreEqual(_bufferData, bytesSent.Take(_bufferData.Length));
|
||||
CollectionAssert.AreEqual(_data.Take(0, _count), bytesSent.Take(_bufferData.Length, _count));
|
||||
|
||||
_channelSessionMock.VerifyAll();
|
||||
}
|
||||
|
||||
+1
-3
@@ -141,9 +141,7 @@ namespace Renci.SshNet.Tests.Classes
|
||||
|
||||
_shellStream.Flush();
|
||||
|
||||
Assert.IsNotNull(actualBytesSent);
|
||||
Assert.HasCount(expectedBytesSent.Length, actualBytesSent);
|
||||
Assert.IsTrue(expectedBytesSent.IsEqualTo(actualBytesSent));
|
||||
CollectionAssert.AreEqual(expectedBytesSent, actualBytesSent);
|
||||
|
||||
_channelSessionMock.VerifyAll();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user