Skip to content

Commit 1af0169

Browse files
Port shared tests folder (#1467)
These tests were presumably once shared with the old integration tests repo but have since been sat doing nothing. This brings them into the unit tests project. Co-authored-by: Wojciech Nagórski <[email protected]>
1 parent a067e28 commit 1af0169

19 files changed

+502
-1613
lines changed

src/Renci.SshNet/Abstractions/SocketAbstraction.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ public static int Read(Socket socket, byte[] buffer, int offset, int size, TimeS
292292
{
293293
if (IsErrorResumable(ex.SocketErrorCode))
294294
{
295-
ThreadAbstraction.Sleep(30);
295+
Thread.Sleep(30);
296296
continue;
297297
}
298298

@@ -346,7 +346,7 @@ public static void Send(Socket socket, byte[] data, int offset, int size)
346346
if (IsErrorResumable(ex.SocketErrorCode))
347347
{
348348
// socket buffer is probably full, wait and try again
349-
ThreadAbstraction.Sleep(30);
349+
Thread.Sleep(30);
350350
}
351351
else
352352
{

src/Renci.SshNet/Abstractions/ThreadAbstraction.cs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,6 @@ namespace Renci.SshNet.Abstractions
66
{
77
internal static class ThreadAbstraction
88
{
9-
/// <summary>
10-
/// Suspends the current thread for the specified number of milliseconds.
11-
/// </summary>
12-
/// <param name="millisecondsTimeout">The number of milliseconds for which the thread is suspended.</param>
13-
public static void Sleep(int millisecondsTimeout)
14-
{
15-
Thread.Sleep(millisecondsTimeout);
16-
}
17-
189
/// <summary>
1910
/// Creates and starts a long-running <see cref="Task"/> for the specified <see cref="Action"/>.
2011
/// </summary>

src/Renci.SshNet/SshMessageFactory.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ internal sealed class SshMessageFactory
1616
private readonly bool[] _activatedMessagesById;
1717
private readonly object _lock = new object();
1818

19-
private static readonly MessageMetadata[] AllMessages = new MessageMetadata[]
19+
internal static readonly MessageMetadata[] AllMessages = new MessageMetadata[]
2020
{
2121
new MessageMetadata<KeyExchangeInitMessage>(0, "SSH_MSG_KEXINIT", 20),
2222
new MessageMetadata<NewKeysMessage>(1, "SSH_MSG_NEWKEYS", 21),
@@ -263,7 +263,7 @@ private static SshException CreateMessageTypeAlreadyEnabledForOtherMessageExcept
263263
currentEnabledForMessageName));
264264
}
265265

266-
private abstract class MessageMetadata
266+
internal abstract class MessageMetadata
267267
{
268268
protected MessageMetadata(byte id, string name, byte number)
269269
{

test/Renci.SshNet.Shared.Tests/Abstractions/CryptoAbstraction_GenerateRandom.cs

Lines changed: 0 additions & 49 deletions
This file was deleted.

test/Renci.SshNet.Shared.Tests/Abstractions/DnsAbstraction_GetHostAddresses.cs

Lines changed: 0 additions & 84 deletions
This file was deleted.

test/Renci.SshNet.Shared.Tests/Abstractions/FileSystemAbstraction_EnumerateFiles.cs

Lines changed: 0 additions & 162 deletions
This file was deleted.

test/Renci.SshNet.Shared.Tests/Abstractions/SocketAbstraction_CanWrite.cs

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)