Skip to content

Commit c728fba

Browse files
committed
Merge branch 'develop' of https://github.com/sshnet/SSH.NET into develop
2 parents 03c6d60 + bc99ada commit c728fba

File tree

56 files changed

+3532
-173
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+3532
-173
lines changed

appveyor.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ build:
99

1010
test_script:
1111
- cmd: >-
12-
vstest.console /logger:Appveyor src\Renci.SshNet.Tests\bin\Debug\net40\Renci.SshNet.Tests.dll /TestCaseFilter:"TestCategory!=integration&TestCategory!=LongRunning"
12+
vstest.console /logger:Appveyor src\Renci.SshNet.Tests\bin\Debug\net35\Renci.SshNet.Tests.dll /TestCaseFilter:"TestCategory!=integration&TestCategory!=LongRunning"
1313
14-
vstest.console /logger:Appveyor src\Renci.SshNet.Tests\bin\Debug\net35\Renci.SshNet.Tests.dll /TestCaseFilter:"TestCategory!=integration&TestCategory!=LongRunning"
14+
vstest.console /logger:Appveyor src\Renci.SshNet.Tests\bin\Debug\net472\Renci.SshNet.Tests.dll /TestCaseFilter:"TestCategory!=integration&TestCategory!=LongRunning"

build/sandcastle/SSH.NET.shfbproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<PresentationStyle>VS2010</PresentationStyle>
2828
<Preliminary>False</Preliminary>
2929
<NamingMethod>Guid</NamingMethod>
30-
<HelpTitle>SSH.NET Client Library Documenation</HelpTitle>
30+
<HelpTitle>SSH.NET Client Library Documentation</HelpTitle>
3131
<ContentPlacement>AboveNamespaces</ContentPlacement>
3232
<ComponentConfigurations>
3333
<ComponentConfig id="Code Block Component" enabled="True">
@@ -73,4 +73,4 @@
7373
</PropertyGroup>
7474
<!-- Import the SHFB build targets -->
7575
<Import Project="$(SHFBROOT)\SandcastleHelpFileBuilder.targets" />
76-
</Project>
76+
</Project>

src/Renci.SshNet.Tests/Classes/BaseClientTest_Connected_KeepAliveInterval_NegativeOne.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public void IsConnectedOnSessionShouldBeInvokedOnce()
9494
}
9595

9696
[TestMethod]
97-
public void SendMessageOnSessionShouldBeInvokedThreeTimes()
97+
public void SendMessageOnSessionShouldBeInvokedOneTime()
9898
{
9999
// allow keep-alive to be sent once
100100
Thread.Sleep(100);

src/Renci.SshNet.Tests/Classes/Common/PacketDumpTest.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,11 @@ public void Create_ByteArrayAndIndentLevel_IndentLevelLessThanZero()
3737
catch (ArgumentOutOfRangeException ex)
3838
{
3939
Assert.IsNull(ex.InnerException);
40+
#if NETFRAMEWORK
4041
Assert.AreEqual(string.Format("Cannot be less than zero.{0}Parameter name: {1}", Environment.NewLine, ex.ParamName), ex.Message);
42+
#else
43+
Assert.AreEqual(string.Format("Cannot be less than zero. (Parameter '{1}')", Environment.NewLine, ex.ParamName), ex.Message);
44+
#endif
4145
Assert.AreEqual("indentLevel", ex.ParamName);
4246
}
4347
}

src/Renci.SshNet.Tests/Classes/PrivateKeyFileTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ public void ConstructorWithFileNameAndPassphrase()
435435
/// A test for <see cref="PrivateKeyFile(string, string)"/> ctor.
436436
///</summary>
437437
[TestMethod()]
438-
public void ConstructorWithFileNameAndPassphraseShouldThrowSshPassPhraseNullOrEmptyExceptionWhenPrivateKeyIsEncryptedAndPassphraseIsEmpty()
438+
public void ConstructorWithFileNameAndPassphraseShouldThrowSshPassPhraseNullOrEmptyExceptionWhenNeededPassphraseIsEmpty()
439439
{
440440
var passphrase = string.Empty;
441441

@@ -460,7 +460,7 @@ public void ConstructorWithFileNameAndPassphraseShouldThrowSshPassPhraseNullOrEm
460460
/// A test for <see cref="PrivateKeyFile(string, string)"/> ctor.
461461
///</summary>
462462
[TestMethod()]
463-
public void ConstructorWithFileNameAndPassphraseShouldThrowSshPassPhraseNullOrEmptyExceptionWhenPrivateKeyIsEncryptedAndPassphraseIsNull()
463+
public void ConstructorWithFileNameAndPassphraseShouldThrowSshPassPhraseNullOrEmptyExceptionWhenNeededPassphraseIsNull()
464464
{
465465
string passphrase = null;
466466

src/Renci.SshNet.Tests/Classes/ScpClientTest_Download_PathAndDirectoryInfo_SendExecRequestReturnsFalse.cs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ protected override void SetupMocks()
5454
.Setup(p => p.SendExecRequest(string.Format("scp -prf {0}", _transformedPath)))
5555
.Returns(false);
5656
_channelSessionMock.InSequence(sequence).Setup(p => p.Dispose());
57+
#if NET35
5758
_pipeStreamMock.As<IDisposable>().InSequence(sequence).Setup(p => p.Dispose());
58-
59-
// On .NET Core, Dispose() in turn invokes Close() and since we're not mocking
60-
// an interface, we need to expect this call as well
61-
_pipeStreamMock.Setup(p => p.Close());
59+
#else
60+
_pipeStreamMock.InSequence(sequence).Setup(p => p.Close());
61+
#endif
6262
}
6363

6464
protected override void Arrange()
@@ -106,7 +106,11 @@ public void DisposeOnChannelShouldBeInvokedOnce()
106106
[TestMethod]
107107
public void DisposeOnPipeStreamShouldBeInvokedOnce()
108108
{
109+
#if NET35
109110
_pipeStreamMock.As<IDisposable>().Verify(p => p.Dispose(), Times.Once);
111+
#else
112+
_pipeStreamMock.Verify(p => p.Close(), Times.Once);
113+
#endif
110114
}
111115

112116
[TestMethod]

src/Renci.SshNet.Tests/Classes/ScpClientTest_Download_PathAndFileInfo_SendExecRequestReturnsFalse.cs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@ protected override void SetupMocks()
5353
_channelSessionMock.InSequence(sequence)
5454
.Setup(p => p.SendExecRequest(string.Format("scp -pf {0}", _transformedPath))).Returns(false);
5555
_channelSessionMock.InSequence(sequence).Setup(p => p.Dispose());
56+
#if NET35
5657
_pipeStreamMock.As<IDisposable>().InSequence(sequence).Setup(p => p.Dispose());
57-
58-
// On .NET Core, Dispose() in turn invokes Close() and since we're not mocking
59-
// an interface, we need to expect this call as well
60-
_pipeStreamMock.Setup(p => p.Close());
58+
#else
59+
_pipeStreamMock.InSequence(sequence).Setup(p => p.Close());
60+
#endif
6161
}
6262

6363
protected override void Arrange()
@@ -105,7 +105,11 @@ public void DisposeOnChannelShouldBeInvokedOnce()
105105
[TestMethod]
106106
public void DisposeOnPipeStreamShouldBeInvokedOnce()
107107
{
108+
#if NET35
108109
_pipeStreamMock.As<IDisposable>().Verify(p => p.Dispose(), Times.Once);
110+
#else
111+
_pipeStreamMock.Verify(p => p.Close(), Times.Once);
112+
#endif
109113
}
110114

111115
[TestMethod]

src/Renci.SshNet.Tests/Classes/ScpClientTest_Download_PathAndStream_SendExecRequestReturnsFalse.cs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ protected override void SetupMocks()
5454
.Setup(p => p.SendExecRequest(string.Format("scp -f {0}", _transformedPath)))
5555
.Returns(false);
5656
_channelSessionMock.InSequence(sequence).Setup(p => p.Dispose());
57+
#if NET35
5758
_pipeStreamMock.As<IDisposable>().InSequence(sequence).Setup(p => p.Dispose());
58-
59-
// On .NET Core, Dispose() in turn invokes Close() and since we're not mocking
60-
// an interface, we need to expect this call as well
61-
_pipeStreamMock.Setup(p => p.Close());
59+
#else
60+
_pipeStreamMock.InSequence(sequence).Setup(p => p.Close());
61+
#endif
6262
}
6363

6464
protected override void Arrange()
@@ -116,7 +116,11 @@ public void DisposeOnChannelShouldBeInvokedOnce()
116116
[TestMethod]
117117
public void DisposeOnPipeStreamShouldBeInvokedOnce()
118118
{
119+
#if NET35
119120
_pipeStreamMock.As<IDisposable>().Verify(p => p.Dispose(), Times.Once);
121+
#else
122+
_pipeStreamMock.Verify(p => p.Close(), Times.Once);
123+
#endif
120124
}
121125

122126
[TestMethod]

src/Renci.SshNet.Tests/Classes/ScpClientTest_Upload_DirectoryInfoAndPath_SendExecRequestReturnsFalse.cs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@ protected override void SetupMocks()
5353
.Setup(p => p.SendExecRequest(string.Format("scp -r -p -d -t {0}", _transformedPath)))
5454
.Returns(false);
5555
_channelSessionMock.InSequence(sequence).Setup(p => p.Dispose());
56+
#if NET35
5657
_pipeStreamMock.As<IDisposable>().InSequence(sequence).Setup(p => p.Dispose());
57-
58-
// On .NET Core, Dispose() in turn invokes Close() and since we're not mocking
59-
// an interface, we need to expect this call as well
60-
_pipeStreamMock.Setup(p => p.Close());
58+
#else
59+
_pipeStreamMock.InSequence(sequence).Setup(p => p.Close());
60+
#endif
6161
}
6262

6363
protected override void Arrange()
@@ -105,7 +105,11 @@ public void DisposeOnChannelShouldBeInvokedOnce()
105105
[TestMethod]
106106
public void DisposeOnPipeStreamShouldBeInvokedOnce()
107107
{
108+
#if NET35
108109
_pipeStreamMock.As<IDisposable>().Verify(p => p.Dispose(), Times.Once);
110+
#else
111+
_pipeStreamMock.Verify(p => p.Close(), Times.Once);
112+
#endif
109113
}
110114

111115
[TestMethod]

src/Renci.SshNet.Tests/Classes/ScpClientTest_Upload_FileInfoAndPath_SendExecRequestReturnsFalse.cs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,12 @@ protected override void SetupMocks()
5959
.Setup(p => p.SendExecRequest(string.Format("scp -t -d {0}", _transformedPath)))
6060
.Returns(false);
6161
_channelSessionMock.InSequence(sequence).Setup(p => p.Dispose());
62+
#if NET35
6263
_pipeStreamMock.As<IDisposable>().InSequence(sequence).Setup(p => p.Dispose());
63-
64-
// On .NET Core, Dispose() in turn invokes Close() and since we're not mocking
65-
// an interface, we need to expect this call as well
66-
_pipeStreamMock.Setup(p => p.Close());
67-
}
64+
#else
65+
_pipeStreamMock.InSequence(sequence).Setup(p => p.Close());
66+
#endif
67+
}
6868

6969
protected override void Arrange()
7070
{
@@ -122,7 +122,11 @@ public void DisposeOnChannelShouldBeInvokedOnce()
122122
[TestMethod]
123123
public void DisposeOnPipeStreamShouldBeInvokedOnce()
124124
{
125+
#if NET35
125126
_pipeStreamMock.As<IDisposable>().Verify(p => p.Dispose(), Times.Once);
127+
#else
128+
_pipeStreamMock.Verify(p => p.Close(), Times.Once);
129+
#endif
126130
}
127131

128132
[TestMethod]

0 commit comments

Comments
 (0)