Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using System.Text;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moq;
Expand DownExpand Up@@ -27,15 +26,13 @@ public class ServiceFactoryTest_CreateShellStream_ChannelOpenThrowsException

private void SetupData()
{
var random = new Random();

_terminalName = random.Next().ToString();
_columns = (uint) random.Next();
_rows = (uint) random.Next();
_width = (uint) random.Next();
_height = (uint) random.Next();
_terminalName = "test";
_columns = 80;
_rows = 20;
_width = 300;
_height = 100;
_terminalModeValues = new Dictionary<TerminalModes, uint>();
_bufferSize = random.Next();
_bufferSize = 512;
_channelOpenException = new SshException();

_actualException = null;
Expand DownExpand Up@@ -117,4 +114,4 @@ public void DisposeOnChannelSessionShouldHaveBeenInvokedOnce()
_channelSessionMock.Verify(p => p.Dispose(), Times.Once);
}
}
}
}
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using System.Text;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moq;
Expand All@@ -26,15 +25,13 @@ public class ServiceFactoryTest_CreateShellStream_SendPseudoTerminalRequestRetur

private void SetupData()
{
var random = new Random();

_terminalName = random.Next().ToString();
_columns = (uint)random.Next();
_rows = (uint)random.Next();
_width = (uint)random.Next();
_height = (uint)random.Next();
_terminalName = "test";
_columns = 80;
_rows = 20;
_width = 300;
_height = 100;
_terminalModeValues = new Dictionary<TerminalModes, uint>();
_bufferSize = random.Next();
_bufferSize = 512;
_actualException = null;
}

Expand DownExpand Up@@ -117,4 +114,4 @@ public void DisposeOnChannelSessionShouldHaveBeenInvokedOnce()
_channelSessionMock.Verify(p => p.Dispose(), Times.Once);
}
}
}
}
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using System.Text;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moq;
Expand DownExpand Up@@ -27,15 +26,13 @@ public class ServiceFactoryTest_CreateShellStream_SendPseudoTerminalRequestThrow

private void SetupData()
{
var random = new Random();

_terminalName = random.Next().ToString();
_columns = (uint) random.Next();
_rows = (uint) random.Next();
_width = (uint) random.Next();
_height = (uint) random.Next();
_terminalName = "test";
_columns = 80;
_rows = 20;
_width = 300;
_height = 100;
_terminalModeValues = new Dictionary<TerminalModes, uint>();
_bufferSize = random.Next();
_bufferSize = 512;
_sendPseudoTerminalRequestException = new SshException();

_actualException = null;
Expand DownExpand Up@@ -119,4 +116,4 @@ public void DisposeOnChannelSessionShouldHaveBeenInvokedOnce()
_channelSessionMock.Verify(p => p.Dispose(), Times.Once);
}
}
}
}
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using System.Text;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moq;
Expand All@@ -26,15 +25,13 @@ public class ServiceFactoryTest_CreateShellStream_SendShellRequestReturnsFalse

private void SetupData()
{
var random = new Random();

_terminalName = random.Next().ToString();
_columns = (uint) random.Next();
_rows = (uint) random.Next();
_width = (uint) random.Next();
_height = (uint) random.Next();
_terminalName = "test";
_columns = 80;
_rows = 20;
_width = 300;
_height = 100;
_terminalModeValues = new Dictionary<TerminalModes, uint>();
_bufferSize = random.Next();
_bufferSize = 512;
_actualException = null;
}

Expand DownExpand Up@@ -120,4 +117,4 @@ public void DisposeOnChannelSessionShouldHaveBeenInvokedOnce()
_channelSessionMock.Verify(p => p.Dispose(), Times.Once);
}
}
}
}
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using System.Text;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moq;
Expand DownExpand Up@@ -27,15 +26,13 @@ public class ServiceFactoryTest_CreateShellStream_SendShellRequestThrowsExceptio

private void SetupData()
{
var random = new Random();

_terminalName = random.Next().ToString();
_columns = (uint) random.Next();
_rows = (uint) random.Next();
_width = (uint) random.Next();
_height = (uint) random.Next();
_terminalName = "test";
_columns = 80;
_rows = 20;
_width = 300;
_height = 100;
_terminalModeValues = new Dictionary<TerminalModes, uint>();
_bufferSize = random.Next();
_bufferSize = 512;
_sendShellRequestException = new SshException();
_actualException = null;
}
Expand DownExpand Up@@ -121,4 +118,4 @@ public void DisposeOnChannelSessionShouldHaveBeenInvokedOnce()
_channelSessionMock.Verify(p => p.Dispose(), Times.Once);
}
}
}
}
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using System.Text;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moq;
Expand All@@ -26,15 +25,13 @@ public class ServiceFactoryTest_CreateShellStream_Success

private void SetupData()
{
var random = new Random();

_terminalName = random.Next().ToString();
_columns = (uint) random.Next();
_rows = (uint) random.Next();
_width = (uint) random.Next();
_height = (uint) random.Next();
_terminalName = "test";
_columns = 80;
_rows = 20;
_width = 300;
_height = 100;
_terminalModeValues = new Dictionary<TerminalModes, uint>();
_bufferSize = random.Next();
_bufferSize = 512;
}

private void CreateMocks()
Expand DownExpand Up@@ -124,4 +121,4 @@ public void SendShellRequestShouldHaveBeenInvokedOnce()
_channelSessionMock.Verify(p => p.SendShellRequest(), Times.Once);
}
}
}
}
Original file line numberDiff line numberDiff line change
Expand Up@@ -10,7 +10,7 @@
namespace Renci.SshNet.Tests.Classes.Sftp
{
[TestClass]
public class SftpFileReaderTest_Read_ReahAheadExceptionInBeginRead : SftpFileReaderTestBase
public class SftpFileReaderTest_Read_ReadAheadExceptionInBeginRead : SftpFileReaderTestBase
{
private const int ChunkLength = 32 * 1024;

Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -29,7 +29,7 @@ protected override void SetupData()
var random = new Random();

_handle = CreateByteArray(random, 5);
_fileSize = random.Next();
_fileSize = 1234;
_waitHandleArray = new WaitHandle[2];
_operationTimeout = random.Next(10000, 20000);
_closeAsyncResult = new SftpCloseAsyncResult(null, null);
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -28,7 +28,7 @@ protected override void SetupData()
_bufferSize = (uint) random.Next(1, 1000);
_readBufferSize = (uint) random.Next(1, 1000);
_writeBufferSize = (uint) random.Next(1, 1000);
_length = random.Next();
_length = 5555;
}

protected override void SetupMocks()
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,7 +7,7 @@
namespace Renci.SshNet.Tests.Classes.Sftp
{
[TestClass]
public class SftpFileStreamTest_SetLength_SessionOpen_FIleAccess : SftpFileStreamTestBase
public class SftpFileStreamTest_SetLength_SessionOpen_FileAccessRead : SftpFileStreamTestBase
{
private SftpFileStream _target;
private string _path;
Expand All@@ -28,7 +28,7 @@ protected override void SetupData()
_bufferSize = (uint) random.Next(1, 1000);
_readBufferSize = (uint) random.Next(1, 1000);
_writeBufferSize = (uint) random.Next(1, 1000);
_length = random.Next();
_length = 6666;
}

protected override void SetupMocks()
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,7 +9,7 @@
namespace Renci.SshNet.Tests.Classes.Sftp
{
[TestClass]
public class SftpFileStreamTest_SetLength_SessionOpen_FIleAccessReadWrite
public class SftpFileStreamTest_SetLength_SessionOpen_FileAccessReadWrite
{
private Mock<ISftpSession> _sftpSessionMock;
private string _path;
Expand DownExpand Up@@ -46,7 +46,7 @@ protected void Arrange()
_bufferSize = (uint) random.Next(1, 1000);
_readBufferSize = (uint) random.Next(1, 1000);
_writeBufferSize = (uint) random.Next(1, 1000);
_length = random.Next();
_length = 7777;

_fileAttributesLastAccessTime = DateTime.UtcNow.AddSeconds(random.Next());
_fileAttributesLastWriteTime = DateTime.UtcNow.AddSeconds(random.Next());
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,7 +9,7 @@
namespace Renci.SshNet.Tests.Classes.Sftp
{
[TestClass]
public class SftpFileStreamTest_SetLength_SessionOpen_FIleAccessWrite
public class SftpFileStreamTest_SetLength_SessionOpen_FileAccessWrite
{
private Mock<ISftpSession> _sftpSessionMock;
private string _path;
Expand DownExpand Up@@ -46,7 +46,7 @@ protected void Arrange()
_bufferSize = (uint) random.Next(1, 1000);
_readBufferSize = (uint) random.Next(1, 1000);
_writeBufferSize = (uint) random.Next(1, 1000);
_length = random.Next();
_length = 8888;

_fileAttributesLastAccessTime = DateTime.UtcNow.AddSeconds(random.Next());
_fileAttributesLastWriteTime = DateTime.UtcNow.AddSeconds(random.Next());
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -121,10 +121,10 @@ public void LengthShouldFlushBufferAndReturnSizeOfFile()
{
var lengthFileAttributes = new SftpFileAttributes(DateTime.UtcNow,
DateTime.UtcNow,
_random.Next(),
_random.Next(),
_random.Next(),
(uint) _random.Next(0, int.MaxValue),
123,
456,
789,
7,
null);
byte[] actualFlushedData = null;

Expand Down