mirror of
https://github.com/sshnet/SSH.NET.git
synced 2026-10-28 22:49:59 +08:00
Remove ServiceFactory argument from SftpSession.
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user