GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Send SSH_MSG_CHANNEL_EOF and SSH_MSG_CHANNEL_CLOSE in synchronized bl… · bazauto/SSH.NET@1d6177f

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • src
    • Renci.SshNet.Tests
      • Classes
        • Channels
          • ChannelDirectTcpipTest.cs
          • ChannelDirectTcpipTest_Dispose_SessionIsConnectedAndChannelIsOpen.cs
          • ChannelForwardedTcpipTest_Dispose_SessionIsConnectedAndChannelIsOpen.cs
          • ChannelSessionTest_Dispose_Disposed.cs
          • ChannelSessionTest_Dispose_SessionIsConnectedAndChannelIsOpen_ChannelCloseAndChannelEofReceived_SendChannelCloseMessageFailure.cs
          • ChannelSessionTest_Dispose_SessionIsConnectedAndChannelIsOpen_ChannelCloseAndChannelEofReceived_SendChannelCloseMessageSuccess.cs
          • ChannelSessionTest_Dispose_SessionIsConnectedAndChannelIsOpen_ChannelCloseReceived_SendChannelCloseMessageFailure.cs
          • ChannelSessionTest_Dispose_SessionIsConnectedAndChannelIsOpen_ChannelCloseReceived_SendChannelCloseMessageSuccess.cs
          • ChannelSessionTest_Dispose_SessionIsConnectedAndChannelIsOpen_ChannelEofReceived_SendChannelCloseMessageFailure.cs
          • ChannelSessionTest_Dispose_SessionIsConnectedAndChannelIsOpen_ChannelEofReceived_SendChannelCloseMessageSuccess.cs
          • ChannelSessionTest_Dispose_SessionIsConnectedAndChannelIsOpen_NoChannelCloseOrChannelEofReceived.cs
          • ChannelSessionTest_Dispose_SessionIsConnectedAndChannelIsOpen_NoChannelCloseOrChannelEofReceived_SendChannelEofMessageFailure.cs
          • ChannelSessionTest_Dispose_SessionIsNotConnectedAndChannelIsOpen_ChannelCloseAndChannelEofReceived.cs
          • ChannelSessionTest_Dispose_SessionIsNotConnectedAndChannelIsOpen_ChannelCloseReceived.cs
          • ChannelSessionTest_Dispose_SessionIsNotConnectedAndChannelIsOpen_NoChannelCloseOrChannelEofReceived.cs
          • ChannelSessionTest_Disposed_Closed.cs
          • ChannelSessionTest_OnSessionChannelCloseReceived_SessionIsConnectedAndChannelIsOpen.cs
          • ChannelTest_Dispose_SessionIsConnectedAndChannelIsNotOpen.cs
          • ChannelTest_Dispose_SessionIsConnectedAndChannelIsOpen_EofNotReceived.cs
          • ChannelTest_Dispose_SessionIsConnectedAndChannelIsOpen_EofNotReceived_SendEofInvoked.cs
          • ChannelTest_Dispose_SessionIsConnectedAndChannelIsOpen_EofReceived.cs
          • ChannelTest_Dispose_SessionIsNotConnectedAndChannelIsNotOpen.cs
          • ChannelTest_Dispose_SessionIsNotConnectedAndChannelIsOpen.cs
          • ChannelTest_OnSessionChannelCloseReceived_OnClose_Exception.cs
          • ChannelTest_OnSessionChannelCloseReceived_SessionIsConnectedAndChannelIsOpen_EofNotReceived.cs
          • ChannelTest_OnSessionChannelCloseReceived_SessionIsConnectedAndChannelIsOpen_EofReceived.cs
        • ForwardedPortDynamicTest_Dispose_PortStarted_ChannelBound.cs
        • ForwardedPortDynamicTest_Dispose_PortStarted_ChannelNotBound.cs
        • ForwardedPortDynamicTest_SessionErrorOccurred_ChannelBound.cs
        • ForwardedPortDynamicTest_Started_SocketSendShutdownImmediately.cs
        • ForwardedPortDynamicTest_Started_SocketVersionNotSupported.cs
        • ForwardedPortDynamicTest_Stop_PortStarted_ChannelBound.cs
        • ForwardedPortDynamicTest_Stop_PortStarted_ChannelNotBound.cs
        • ForwardedPortLocalTest_Dispose_PortStarted_ChannelBound.cs
        • ForwardedPortLocalTest_Start_PortNeverStarted.cs
        • ForwardedPortLocalTest_Start_PortStarted.cs
        • ForwardedPortLocalTest_Start_PortStopped.cs
        • ForwardedPortLocalTest_Stop_PortStarted_ChannelBound.cs
        • ForwardedPortRemoteTest_Dispose_PortStarted_ChannelBound.cs
        • ForwardedPortRemoteTest_Start_PortNeverStarted.cs
        • ForwardedPortRemoteTest_Start_PortStarted.cs
        • ForwardedPortRemoteTest_Start_PortStopped.cs
        • ForwardedPortRemoteTest_Started.cs
        • ScpClientTest_Upload_FileInfoAndPath_SendExecRequestReturnsFalse.cs
        • ScpClientTest_Upload_FileInfoAndPath_Success.cs
        • SessionTest_Connected_ConnectionReset.cs
        • SessionTest_Connected_ServerSendsBadPacket.cs
        • SessionTest_Connected_ServerShutsDownSendAfterSendingIncompletePacket.cs
        • SessionTest_Connected_ServerShutsDownSocket.cs
        • SshClientTest.cs
        • SshCommandTest_BeginExecute_EndExecuteInvokedOnAsyncResultFromPreviousInvocation.cs
        • SshCommandTest_EndExecute.cs
        • SshCommandTest_EndExecute_ChannelOpen.cs
        • SubsystemSession_Connect_Connected.cs
        • SubsystemSession_Connect_Disconnected.cs
        • SubsystemSession_Disconnect_Connected.cs
        • SubsystemSession_Disconnect_Disposed.cs
        • SubsystemSession_Dispose_Connected.cs
        • SubsystemSession_Dispose_Disconnected.cs
        • SubsystemSession_Dispose_Disposed.cs
        • SubsystemSession_OnChannelDataReceived_Connected.cs
        • SubsystemSession_OnChannelDataReceived_Disposed.cs
        • SubsystemSession_OnChannelDataReceived_OnDataReceived_Exception.cs
        • SubsystemSession_OnChannelException_Connected.cs
        • SubsystemSession_OnChannelException_Disposed.cs
        • SubsystemSession_OnSessionDisconnected_Connected.cs
        • SubsystemSession_OnSessionDisconnected_Disposed.cs
        • SubsystemSession_OnSessionErrorOccurred_Connected.cs
        • SubsystemSession_OnSessionErrorOccurred_Disposed.cs
        • SubsystemSession_SendData_Disposed.cs
      • Common
        • Extensions.cs
      • Renci.SshNet.Tests.csproj
    • Renci.SshNet
      • Channels
        • Channel.cs
        • ChannelDirectTcpip.cs
        • ChannelForwardedTcpip.cs
        • ChannelSession.cs
        • IChannel.cs
        • IChannelDirectTcpip.cs
        • IChannelForwardedTcpip.cs
      • ForwardedPortDynamic.NET.cs
      • ForwardedPortLocal.NET.cs
      • ForwardedPortRemote.cs
      • ISession.cs
      • ScpClient.NET.cs
      • ScpClient.cs
      • Session.cs
      • Shell.cs
      • ShellStream.cs
      • SshCommand.cs
      • SubsystemSession.cs

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Dismiss banner
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/Renci.SshNet.Tests/Classes/Channels/ChannelDirectTcpipTest.cs‎

Copy file name to clipboardExpand all lines: src/Renci.SshNet.Tests/Classes/Channels/ChannelDirectTcpipTest.cs
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ public void SocketShouldBeClosedAndEofShouldBeSentToServerWhenClientShutsDownSoc
195195
_localPacketSize);
196196
channel.Open(_remoteHost, _port, _forwardedPortMock.Object, socket);
197197
channel.Bind();
198-
channel.Close();
198+
channel.Dispose();
199199

200200
handler = socket;
201201

@@ -215,7 +215,7 @@ public void SocketShouldBeClosedAndEofShouldBeSentToServerWhenClientShutsDownSoc
215215
_sessionMock.Verify(p => p.TrySendMessage(It.IsAny<ChannelEofMessage>()), Times.Once);
216216
_sessionMock.Verify(p => p.TrySendMessage(It.IsAny<ChannelCloseMessage>()), Times.Once);
217217

218-
channel.Close();
218+
channel.Dispose();
219219

220220
_sessionMock.Verify(p => p.TrySendMessage(It.IsAny<ChannelEofMessage>()), Times.Once);
221221
_sessionMock.Verify(p => p.TrySendMessage(It.IsAny<ChannelCloseMessage>()), Times.Once);
Collapse file

‎…se_SessionIsConnectedAndChannelIsOpen.cs‎ ‎…se_SessionIsConnectedAndChannelIsOpen.cs‎src/Renci.SshNet.Tests/Classes/Channels/ChannelDirectTcpipTest_Close_SessionIsConnectedAndChannelIsOpen.cs renamed to src/Renci.SshNet.Tests/Classes/Channels/ChannelDirectTcpipTest_Dispose_SessionIsConnectedAndChannelIsOpen.cs src/Renci.SshNet.Tests/Classes/Channels/ChannelDirectTcpipTest_Close_SessionIsConnectedAndChannelIsOpen.cs renamed to src/Renci.SshNet.Tests/Classes/Channels/ChannelDirectTcpipTest_Dispose_SessionIsConnectedAndChannelIsOpen.cs

Copy file name to clipboardExpand all lines: src/Renci.SshNet.Tests/Classes/Channels/ChannelDirectTcpipTest_Dispose_SessionIsConnectedAndChannelIsOpen.cs
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
namespace Renci.SshNet.Tests.Classes.Channels
1313
{
1414
[TestClass]
15-
public class ChannelDirectTcpipTest_Close_SessionIsConnectedAndChannelIsOpen
15+
public class ChannelDirectTcpipTest_Dispose_SessionIsConnectedAndChannelIsOpen
1616
{
1717
private Mock<ISession> _sessionMock;
1818
private Mock<IForwardedPort> _forwardedPortMock;
@@ -165,7 +165,7 @@ private void Act()
165165
{
166166
if (_channel != null)
167167
{
168-
_channel.Close();
168+
_channel.Dispose();
169169
}
170170
}
171171

Collapse file

‎…se_SessionIsConnectedAndChannelIsOpen.cs‎ ‎…se_SessionIsConnectedAndChannelIsOpen.cs‎src/Renci.SshNet.Tests/Classes/Channels/ChannelForwardedTcpipTest_Close_SessionIsConnectedAndChannelIsOpen.cs renamed to src/Renci.SshNet.Tests/Classes/Channels/ChannelForwardedTcpipTest_Dispose_SessionIsConnectedAndChannelIsOpen.cs src/Renci.SshNet.Tests/Classes/Channels/ChannelForwardedTcpipTest_Close_SessionIsConnectedAndChannelIsOpen.cs renamed to src/Renci.SshNet.Tests/Classes/Channels/ChannelForwardedTcpipTest_Dispose_SessionIsConnectedAndChannelIsOpen.cs

Copy file name to clipboardExpand all lines: src/Renci.SshNet.Tests/Classes/Channels/ChannelForwardedTcpipTest_Dispose_SessionIsConnectedAndChannelIsOpen.cs
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
namespace Renci.SshNet.Tests.Classes.Channels
1414
{
1515
[TestClass]
16-
public class ChannelForwardedTcpipTest_Close_SessionIsConnectedAndChannelIsOpen
16+
public class ChannelForwardedTcpipTest_Dispose_SessionIsConnectedAndChannelIsOpen
1717
{
1818
private Mock<ISession> _sessionMock;
1919
private Mock<IForwardedPort> _forwardedPortMock;
@@ -157,7 +157,7 @@ private void Arrange()
157157

158158
private void Act()
159159
{
160-
_channel.Close();
160+
_channel.Dispose();
161161
}
162162

163163
[TestMethod]
Collapse file

‎…nnels/ChannelSessionTest_Close_Closed.cs‎ ‎…s/ChannelSessionTest_Dispose_Disposed.cs‎src/Renci.SshNet.Tests/Classes/Channels/ChannelSessionTest_Close_Closed.cs renamed to src/Renci.SshNet.Tests/Classes/Channels/ChannelSessionTest_Dispose_Disposed.cs src/Renci.SshNet.Tests/Classes/Channels/ChannelSessionTest_Close_Closed.cs renamed to src/Renci.SshNet.Tests/Classes/Channels/ChannelSessionTest_Dispose_Disposed.cs

Copy file name to clipboardExpand all lines: src/Renci.SshNet.Tests/Classes/Channels/ChannelSessionTest_Dispose_Disposed.cs
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
namespace Renci.SshNet.Tests.Classes.Channels
1111
{
1212
[TestClass]
13-
public class ChannelSessionTest_Close_Closed
13+
public class ChannelSessionTest_Dispose_Disposed
1414
{
1515
private Mock<ISession> _sessionMock;
1616
private Mock<IConnectionInfo> _connectionInfoMock;
@@ -97,12 +97,12 @@ private void Arrange()
9797
_channel.Closed += (sender, args) => _channelClosedRegister.Add(args);
9898
_channel.Exception += (sender, args) => _channelExceptionRegister.Add(args);
9999
_channel.Open();
100-
_channel.Close();
100+
_channel.Dispose();
101101
}
102102

103103
protected virtual void Act()
104104
{
105-
_channel.Close();
105+
_channel.Dispose();
106106
}
107107

108108
internal ChannelSession Channel
Collapse file

‎…ceived_SendChannelCloseMessageFailure.cs‎ ‎…ceived_SendChannelCloseMessageFailure.cs‎src/Renci.SshNet.Tests/Classes/Channels/ChannelSessionTest_Close_SessionIsConnectedAndChannelIsOpen_ChannelCloseAndChannelEofReceived_SendChannelCloseMessageFailure.cs renamed to src/Renci.SshNet.Tests/Classes/Channels/ChannelSessionTest_Dispose_SessionIsConnectedAndChannelIsOpen_ChannelCloseAndChannelEofReceived_SendChannelCloseMessageFailure.cs src/Renci.SshNet.Tests/Classes/Channels/ChannelSessionTest_Close_SessionIsConnectedAndChannelIsOpen_ChannelCloseAndChannelEofReceived_SendChannelCloseMessageFailure.cs renamed to src/Renci.SshNet.Tests/Classes/Channels/ChannelSessionTest_Dispose_SessionIsConnectedAndChannelIsOpen_ChannelCloseAndChannelEofReceived_SendChannelCloseMessageFailure.cs

Copy file name to clipboardExpand all lines: src/Renci.SshNet.Tests/Classes/Channels/ChannelSessionTest_Dispose_SessionIsConnectedAndChannelIsOpen_ChannelCloseAndChannelEofReceived_SendChannelCloseMessageFailure.cs
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
namespace Renci.SshNet.Tests.Classes.Channels
1111
{
1212
[TestClass]
13-
public class ChannelSessionTest_Close_SessionIsConnectedAndChannelIsOpen_ChannelCloseAndChannelEofReceived_SendChannelCloseMessageFailure
13+
public class ChannelSessionTest_Dispose_SessionIsConnectedAndChannelIsOpen_ChannelCloseAndChannelEofReceived_SendChannelCloseMessageFailure
1414
{
1515
private Mock<ISession> _sessionMock;
1616
private uint _localChannelNumber;
@@ -100,7 +100,7 @@ private void Arrange()
100100

101101
private void Act()
102102
{
103-
_channel.Close();
103+
_channel.Dispose();
104104
}
105105

106106
[TestMethod]
Collapse file

‎…ceived_SendChannelCloseMessageSuccess.cs‎ ‎…ceived_SendChannelCloseMessageSuccess.cs‎src/Renci.SshNet.Tests/Classes/Channels/ChannelSessionTest_Close_SessionIsConnectedAndChannelIsOpen_ChannelCloseAndChannelEofReceived_SendChannelCloseMessageSuccess.cs renamed to src/Renci.SshNet.Tests/Classes/Channels/ChannelSessionTest_Dispose_SessionIsConnectedAndChannelIsOpen_ChannelCloseAndChannelEofReceived_SendChannelCloseMessageSuccess.cs src/Renci.SshNet.Tests/Classes/Channels/ChannelSessionTest_Close_SessionIsConnectedAndChannelIsOpen_ChannelCloseAndChannelEofReceived_SendChannelCloseMessageSuccess.cs renamed to src/Renci.SshNet.Tests/Classes/Channels/ChannelSessionTest_Dispose_SessionIsConnectedAndChannelIsOpen_ChannelCloseAndChannelEofReceived_SendChannelCloseMessageSuccess.cs

Copy file name to clipboardExpand all lines: src/Renci.SshNet.Tests/Classes/Channels/ChannelSessionTest_Dispose_SessionIsConnectedAndChannelIsOpen_ChannelCloseAndChannelEofReceived_SendChannelCloseMessageSuccess.cs
+8-4Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@
66
using Renci.SshNet.Channels;
77
using Renci.SshNet.Common;
88
using Renci.SshNet.Messages.Connection;
9+
using Renci.SshNet.Tests.Common;
910

1011
namespace Renci.SshNet.Tests.Classes.Channels
1112
{
1213
[TestClass]
13-
public class ChannelSessionTest_Close_SessionIsConnectedAndChannelIsOpen_ChannelCloseAndChannelEofReceived_SendChannelCloseMessageSuccess
14+
public class ChannelSessionTest_Dispose_SessionIsConnectedAndChannelIsOpen_ChannelCloseAndChannelEofReceived_SendChannelCloseMessageSuccess
1415
{
1516
private Mock<ISession> _sessionMock;
1617
private uint _localChannelNumber;
@@ -79,11 +80,14 @@ private void Arrange()
7980
_remoteChannelNumber)));
8081
w.WaitOne();
8182
});
82-
_sessionMock.Setup(p => p.IsConnected).Returns(true);
83+
_sessionMock.InSequence(_sequence).Setup(p => p.IsConnected).Returns(true);
8384
_sessionMock.InSequence(_sequence)
8485
.Setup(
8586
p => p.TrySendMessage(It.Is<ChannelCloseMessage>(c => c.LocalChannelNumber == _remoteChannelNumber)))
8687
.Returns(true);
88+
_sessionMock.InSequence(_sequence)
89+
.Setup(s => s.WaitOnHandle(It.IsNotNull<EventWaitHandle>()))
90+
.Callback<WaitHandle>(w => w.WaitOne());
8791

8892
_channel = new ChannelSession(_sessionMock.Object, _localChannelNumber, _localWindowSize, _localPacketSize);
8993
_channel.Closed += (sender, args) => _channelClosedRegister.Add(args);
@@ -100,7 +104,7 @@ private void Arrange()
100104

101105
private void Act()
102106
{
103-
_channel.Close();
107+
_channel.Dispose();
104108
}
105109

106110
[TestMethod]
@@ -112,7 +116,7 @@ public void CurrentCountOfSessionSemaphoreShouldBeEqualToInitialCount()
112116
[TestMethod]
113117
public void ExceptionShouldNeverHaveFired()
114118
{
115-
Assert.AreEqual(0, _channelExceptionRegister.Count);
119+
Assert.AreEqual(0, _channelExceptionRegister.Count, _channelExceptionRegister.AsString());
116120
}
117121

118122
[TestMethod]
Collapse file

‎…ceived_SendChannelCloseMessageFailure.cs‎ ‎…ceived_SendChannelCloseMessageFailure.cs‎src/Renci.SshNet.Tests/Classes/Channels/ChannelSessionTest_Close_SessionIsConnectedAndChannelIsOpen_ChannelCloseReceived_SendChannelCloseMessageFailure.cs renamed to src/Renci.SshNet.Tests/Classes/Channels/ChannelSessionTest_Dispose_SessionIsConnectedAndChannelIsOpen_ChannelCloseReceived_SendChannelCloseMessageFailure.cs src/Renci.SshNet.Tests/Classes/Channels/ChannelSessionTest_Close_SessionIsConnectedAndChannelIsOpen_ChannelCloseReceived_SendChannelCloseMessageFailure.cs renamed to src/Renci.SshNet.Tests/Classes/Channels/ChannelSessionTest_Dispose_SessionIsConnectedAndChannelIsOpen_ChannelCloseReceived_SendChannelCloseMessageFailure.cs

Copy file name to clipboardExpand all lines: src/Renci.SshNet.Tests/Classes/Channels/ChannelSessionTest_Dispose_SessionIsConnectedAndChannelIsOpen_ChannelCloseReceived_SendChannelCloseMessageFailure.cs
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
namespace Renci.SshNet.Tests.Classes.Channels
1111
{
1212
[TestClass]
13-
public class ChannelSessionTest_Close_SessionIsConnectedAndChannelIsOpen_ChannelCloseReceived_SendChannelCloseMessageFailure
13+
public class ChannelSessionTest_Dispose_SessionIsConnectedAndChannelIsOpen_ChannelCloseReceived_SendChannelCloseMessageFailure
1414
{
1515
private Mock<ISession> _sessionMock;
1616
private uint _localChannelNumber;
@@ -97,7 +97,7 @@ private void Arrange()
9797

9898
private void Act()
9999
{
100-
_channel.Close();
100+
_channel.Dispose();
101101
}
102102

103103
[TestMethod]
Collapse file

‎…ceived_SendChannelCloseMessageSuccess.cs‎ ‎…ceived_SendChannelCloseMessageSuccess.cs‎src/Renci.SshNet.Tests/Classes/Channels/ChannelSessionTest_Close_SessionIsConnectedAndChannelIsOpen_ChannelCloseReceived_SendChannelCloseMessageSuccess.cs renamed to src/Renci.SshNet.Tests/Classes/Channels/ChannelSessionTest_Dispose_SessionIsConnectedAndChannelIsOpen_ChannelCloseReceived_SendChannelCloseMessageSuccess.cs src/Renci.SshNet.Tests/Classes/Channels/ChannelSessionTest_Close_SessionIsConnectedAndChannelIsOpen_ChannelCloseReceived_SendChannelCloseMessageSuccess.cs renamed to src/Renci.SshNet.Tests/Classes/Channels/ChannelSessionTest_Dispose_SessionIsConnectedAndChannelIsOpen_ChannelCloseReceived_SendChannelCloseMessageSuccess.cs

Copy file name to clipboardExpand all lines: src/Renci.SshNet.Tests/Classes/Channels/ChannelSessionTest_Dispose_SessionIsConnectedAndChannelIsOpen_ChannelCloseReceived_SendChannelCloseMessageSuccess.cs
+8-4Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@
66
using Renci.SshNet.Channels;
77
using Renci.SshNet.Common;
88
using Renci.SshNet.Messages.Connection;
9+
using Renci.SshNet.Tests.Common;
910

1011
namespace Renci.SshNet.Tests.Classes.Channels
1112
{
1213
[TestClass]
13-
public class ChannelSessionTest_Close_SessionIsConnectedAndChannelIsOpen_ChannelCloseReceived_SendChannelCloseMessageSuccess
14+
public class ChannelSessionTest_Dispose_SessionIsConnectedAndChannelIsOpen_ChannelCloseReceived_SendChannelCloseMessageSuccess
1415
{
1516
private Mock<ISession> _sessionMock;
1617
private uint _localChannelNumber;
@@ -79,11 +80,14 @@ private void Arrange()
7980
_remoteChannelNumber)));
8081
w.WaitOne();
8182
});
82-
_sessionMock.Setup(p => p.IsConnected).Returns(true);
83+
_sessionMock.InSequence(_sequence).Setup(p => p.IsConnected).Returns(true);
8384
_sessionMock.InSequence(_sequence)
8485
.Setup(
8586
p => p.TrySendMessage(It.Is<ChannelCloseMessage>(c => c.LocalChannelNumber == _remoteChannelNumber)))
8687
.Returns(true);
88+
_sessionMock.InSequence(_sequence)
89+
.Setup(s => s.WaitOnHandle(It.IsNotNull<EventWaitHandle>()))
90+
.Callback<WaitHandle>(w => w.WaitOne());
8791

8892
_channel = new ChannelSession(_sessionMock.Object, _localChannelNumber, _localWindowSize, _localPacketSize);
8993
_channel.Closed += (sender, args) => _channelClosedRegister.Add(args);
@@ -97,7 +101,7 @@ private void Arrange()
97101

98102
private void Act()
99103
{
100-
_channel.Close();
104+
_channel.Dispose();
101105
}
102106

103107
[TestMethod]
@@ -109,7 +113,7 @@ public void CurrentCountOfSessionSemaphoreShouldBeEqualToInitialCount()
109113
[TestMethod]
110114
public void ExceptionShouldNeverHaveFired()
111115
{
112-
Assert.AreEqual(0, _channelExceptionRegister.Count);
116+
Assert.AreEqual(0, _channelExceptionRegister.Count, _channelExceptionRegister.AsString());
113117
}
114118

115119
[TestMethod]
Collapse file

‎…ceived_SendChannelCloseMessageFailure.cs‎ ‎…ceived_SendChannelCloseMessageFailure.cs‎src/Renci.SshNet.Tests/Classes/Channels/ChannelSessionTest_Close_SessionIsConnectedAndChannelIsOpen_ChannelEofReceived_SendChannelCloseMessageFailure.cs renamed to src/Renci.SshNet.Tests/Classes/Channels/ChannelSessionTest_Dispose_SessionIsConnectedAndChannelIsOpen_ChannelEofReceived_SendChannelCloseMessageFailure.cs src/Renci.SshNet.Tests/Classes/Channels/ChannelSessionTest_Close_SessionIsConnectedAndChannelIsOpen_ChannelEofReceived_SendChannelCloseMessageFailure.cs renamed to src/Renci.SshNet.Tests/Classes/Channels/ChannelSessionTest_Dispose_SessionIsConnectedAndChannelIsOpen_ChannelEofReceived_SendChannelCloseMessageFailure.cs

Copy file name to clipboardExpand all lines: src/Renci.SshNet.Tests/Classes/Channels/ChannelSessionTest_Dispose_SessionIsConnectedAndChannelIsOpen_ChannelEofReceived_SendChannelCloseMessageFailure.cs
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
namespace Renci.SshNet.Tests.Classes.Channels
1111
{
1212
[TestClass]
13-
public class ChannelSessionTest_Close_SessionIsConnectedAndChannelIsOpen_ChannelEofReceived_SendChannelCloseMessageFailure
13+
public class ChannelSessionTest_Dispose_SessionIsConnectedAndChannelIsOpen_ChannelEofReceived_SendChannelCloseMessageFailure
1414
{
1515
private Mock<ISession> _sessionMock;
1616
private uint _localChannelNumber;
@@ -97,7 +97,7 @@ private void Arrange()
9797

9898
private void Act()
9999
{
100-
_channel.Close();
100+
_channel.Dispose();
101101
}
102102

103103
[TestMethod]
Collapse file

‎…ceived_SendChannelCloseMessageSuccess.cs‎ ‎…ceived_SendChannelCloseMessageSuccess.cs‎src/Renci.SshNet.Tests/Classes/Channels/ChannelSessionTest_Close_SessionIsConnectedAndChannelIsOpen_ChannelEofReceived_SendChannelCloseMessageSuccess.cs renamed to src/Renci.SshNet.Tests/Classes/Channels/ChannelSessionTest_Dispose_SessionIsConnectedAndChannelIsOpen_ChannelEofReceived_SendChannelCloseMessageSuccess.cs src/Renci.SshNet.Tests/Classes/Channels/ChannelSessionTest_Close_SessionIsConnectedAndChannelIsOpen_ChannelEofReceived_SendChannelCloseMessageSuccess.cs renamed to src/Renci.SshNet.Tests/Classes/Channels/ChannelSessionTest_Dispose_SessionIsConnectedAndChannelIsOpen_ChannelEofReceived_SendChannelCloseMessageSuccess.cs

Copy file name to clipboardExpand all lines: src/Renci.SshNet.Tests/Classes/Channels/ChannelSessionTest_Dispose_SessionIsConnectedAndChannelIsOpen_ChannelEofReceived_SendChannelCloseMessageSuccess.cs
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
namespace Renci.SshNet.Tests.Classes.Channels
1111
{
1212
[TestClass]
13-
public class ChannelSessionTest_Close_SessionIsConnectedAndChannelIsOpen_ChannelEofReceived_SendChannelCloseMessageSuccess
13+
public class ChannelSessionTest_Dispose_SessionIsConnectedAndChannelIsOpen_ChannelEofReceived_SendChannelCloseMessageSuccess
1414
{
1515
private Mock<ISession> _sessionMock;
1616
private uint _localChannelNumber;
@@ -107,7 +107,7 @@ private void Arrange()
107107

108108
private void Act()
109109
{
110-
_channel.Close();
110+
_channel.Dispose();
111111
}
112112

113113
[TestMethod]

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.