public void SshExceptionConstructorTest2() { string message = string.Empty; // TODO: Initialize to an appropriate value Exception inner = null; // TODO: Initialize to an appropriate value SshException target = new SshException(message, inner); Assert.Inconclusive("TODO: Implement code to verify target"); }
public void GetObjectDataTest() { SshException target = new SshException(); // TODO: Initialize to an appropriate value SerializationInfo info = null; // TODO: Initialize to an appropriate value StreamingContext context = new StreamingContext(); // TODO: Initialize to an appropriate value target.GetObjectData(info, context); Assert.Inconclusive("A method that does not return a value cannot be verified."); }
private void Arrange() { var random = new Random(); _localChannelNumber = (uint) random.Next(0, int.MaxValue); _localWindowSize = (uint) random.Next(2000, 3000); _localPacketSize = (uint) random.Next(1000, 2000); _initialSessionSemaphoreCount = random.Next(10, 20); _sessionSemaphore = new SemaphoreLight(_initialSessionSemaphoreCount); _channelClosedRegister = new List<ChannelEventArgs>(); _channelExceptionRegister = new List<ExceptionEventArgs>(); _actualException = null; _failureReasonCode = (uint)random.Next(0, int.MaxValue); _failureDescription = random.Next().ToString(CultureInfo.InvariantCulture); _failureLanguage = random.Next().ToString(CultureInfo.InvariantCulture); _sessionMock = new Mock<ISession>(MockBehavior.Strict); _connectionInfoMock = new Mock<IConnectionInfo>(MockBehavior.Strict); var sequence = new MockSequence(); _sessionMock.InSequence(sequence).Setup(p => p.ConnectionInfo).Returns(_connectionInfoMock.Object); _connectionInfoMock.InSequence(sequence).Setup(p => p.RetryAttempts).Returns(1); _sessionMock.Setup(p => p.SessionSemaphore).Returns(_sessionSemaphore); _sessionMock.InSequence(sequence) .Setup( p => p.SendMessage( It.Is<ChannelOpenMessage>( m => m.LocalChannelNumber == _localChannelNumber && m.InitialWindowSize == _localWindowSize && m.MaximumPacketSize == _localPacketSize && m.Info is SessionChannelOpenInfo))); _sessionMock.InSequence(sequence) .Setup(p => p.WaitOnHandle(It.IsNotNull<WaitHandle>())) .Callback<WaitHandle>( w => { _sessionMock.Raise( s => s.ChannelOpenFailureReceived += null, new MessageEventArgs<ChannelOpenFailureMessage>( new ChannelOpenFailureMessage( _localChannelNumber, _failureDescription, _failureReasonCode, _failureLanguage ))); w.WaitOne(); }); _sessionMock.InSequence(sequence).Setup(p => p.ConnectionInfo).Returns(_connectionInfoMock.Object); _connectionInfoMock.InSequence(sequence).Setup(p => p.RetryAttempts).Returns(1); _channel = new ChannelSession(_sessionMock.Object, _localChannelNumber, _localWindowSize, _localPacketSize); _channel.Closed += (sender, args) => _channelClosedRegister.Add(args); _channel.Exception += (sender, args) => _channelExceptionRegister.Add(args); }
protected virtual void Act() { try { _scpClient.Upload(_fileInfo, _path); Assert.Fail(); } catch (SshException ex) { _actualException = ex; } }
public void SshExceptionConstructorTest() { SshException target = new SshException(); Assert.Inconclusive("TODO: Implement code to verify target"); }
private void Act() { try { _channel.Open(); } catch (SshException ex) { _actualException = ex; } }