|
@@ -25,16 +25,6 @@ namespace Renci.SshNet.Tests.Classes
|
|
|
private int _fileSize;
|
|
private int _fileSize;
|
|
|
private IList<ScpUploadEventArgs> _uploadingRegister;
|
|
private IList<ScpUploadEventArgs> _uploadingRegister;
|
|
|
|
|
|
|
|
- [TestCleanup]
|
|
|
|
|
- public void Cleanup()
|
|
|
|
|
- {
|
|
|
|
|
- if (_fileName != null)
|
|
|
|
|
- {
|
|
|
|
|
- File.Delete(_fileName);
|
|
|
|
|
- _fileName = null;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
protected override void SetupData()
|
|
protected override void SetupData()
|
|
|
{
|
|
{
|
|
|
var random = new Random();
|
|
var random = new Random();
|
|
@@ -95,6 +85,10 @@ namespace Renci.SshNet.Tests.Classes
|
|
|
_pipeStreamMock.InSequence(sequence).Setup(p => p.ReadByte()).Returns(0);
|
|
_pipeStreamMock.InSequence(sequence).Setup(p => p.ReadByte()).Returns(0);
|
|
|
_channelSessionMock.InSequence(sequence).Setup(p => p.Dispose());
|
|
_channelSessionMock.InSequence(sequence).Setup(p => p.Dispose());
|
|
|
_pipeStreamMock.As<IDisposable>().InSequence(sequence).Setup(p => p.Dispose());
|
|
_pipeStreamMock.As<IDisposable>().InSequence(sequence).Setup(p => p.Dispose());
|
|
|
|
|
+
|
|
|
|
|
+ // On .NET Core, Dispose() in turn invokes Close() and since we're not mocking
|
|
|
|
|
+ // an interface, we need to expect this call as well
|
|
|
|
|
+ _pipeStreamMock.Setup(p => p.Close());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
protected override void Arrange()
|
|
protected override void Arrange()
|
|
@@ -109,6 +103,17 @@ namespace Renci.SshNet.Tests.Classes
|
|
|
_scpClient.Connect();
|
|
_scpClient.Connect();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ protected override void TearDown()
|
|
|
|
|
+ {
|
|
|
|
|
+ base.TearDown();
|
|
|
|
|
+
|
|
|
|
|
+ if (_fileName != null)
|
|
|
|
|
+ {
|
|
|
|
|
+ File.Delete(_fileName);
|
|
|
|
|
+ _fileName = null;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
protected override void Act()
|
|
protected override void Act()
|
|
|
{
|
|
{
|
|
|
_scpClient.Upload(_fileInfo, _remotePath);
|
|
_scpClient.Upload(_fileInfo, _remotePath);
|