Remove ServiceFactory argument from SftpSession.

This commit is contained in:
Gert Driesen
2017-02-06 15:15:27 +01:00
parent d57dbff9ee
commit b22690d985
4 changed files with 4 additions and 10 deletions
@@ -14,7 +14,6 @@ namespace Renci.SshNet.Tests.Classes.Sftp
public class SftpSessionTest_Connected_RequestRead
{
private Mock<ISession> _sessionMock;
private Mock<IServiceFactory> _serviceFactoryMock;
private Mock<IChannelSession> _channelSessionMock;
private SftpSession _sftpSession;
private int _operationTimeout;
@@ -40,7 +39,6 @@ namespace Renci.SshNet.Tests.Classes.Sftp
_sessionMock = new Mock<ISession>(MockBehavior.Strict);
_channelSessionMock = new Mock<IChannelSession>(MockBehavior.Strict);
_serviceFactoryMock = new Mock<IServiceFactory>(MockBehavior.Strict);
var sequence = new MockSequence();
@@ -84,7 +82,7 @@ namespace Renci.SshNet.Tests.Classes.Sftp
}
);
_sftpSession = new SftpSession(_sessionMock.Object, _operationTimeout, _encoding, _serviceFactoryMock.Object);
_sftpSession = new SftpSession(_sessionMock.Object, _operationTimeout, _encoding);
_sftpSession.Connect();
}
@@ -14,7 +14,6 @@ namespace Renci.SshNet.Tests.Classes.Sftp
{
private Mock<ISession> _sessionMock;
private Mock<IChannelSession> _channelSessionMock;
private Mock<IServiceFactory> _serviceFactoryMock;
private SftpSession _sftpSession;
private int _operationTimeout;
private SftpFileSytemInformation _actual;
@@ -40,7 +39,6 @@ namespace Renci.SshNet.Tests.Classes.Sftp
_sessionMock = new Mock<ISession>(MockBehavior.Strict);
_channelSessionMock = new Mock<IChannelSession>(MockBehavior.Strict);
_serviceFactoryMock = new Mock<IServiceFactory>(MockBehavior.Strict);
var sequence = new MockSequence();
@@ -84,7 +82,7 @@ namespace Renci.SshNet.Tests.Classes.Sftp
}
);
_sftpSession = new SftpSession(_sessionMock.Object, _operationTimeout, _encoding, _serviceFactoryMock.Object);
_sftpSession = new SftpSession(_sessionMock.Object, _operationTimeout, _encoding);
_sftpSession.Connect();
}
+1 -1
View File
@@ -51,7 +51,7 @@ namespace Renci.SshNet
/// </returns>
public ISftpSession CreateSftpSession(ISession session, int operationTimeout, Encoding encoding)
{
return new SftpSession(session, operationTimeout, encoding, this);
return new SftpSession(session, operationTimeout, encoding);
}
/// <summary>
+1 -3
View File
@@ -17,7 +17,6 @@ namespace Renci.SshNet.Sftp
private readonly Dictionary<uint, SftpRequest> _requests = new Dictionary<uint, SftpRequest>();
//FIXME: obtain from SftpClient!
private readonly List<byte> _data = new List<byte>(32 * 1024);
private readonly IServiceFactory _serviceFactory;
private EventWaitHandle _sftpVersionConfirmed = new AutoResetEvent(false);
private IDictionary<string, string> _supportedExtensions;
@@ -50,10 +49,9 @@ namespace Renci.SshNet.Sftp
}
}
public SftpSession(ISession session, int operationTimeout, Encoding encoding, IServiceFactory serviceFactory)
public SftpSession(ISession session, int operationTimeout, Encoding encoding)
: base(session, "sftp", operationTimeout, encoding)
{
_serviceFactory = serviceFactory;
}
/// <summary>