public void ErrorOccurredIsRaisedOnce() { Assert.AreEqual(1, ErrorOccurredRegister.Count, ErrorOccurredRegister.AsString()); var errorOccurred = ErrorOccurredRegister[0]; Assert.IsNotNull(errorOccurred); var exception = errorOccurred.Exception; Assert.IsNotNull(exception); Assert.AreEqual(typeof(SshConnectionException), exception.GetType()); var connectionException = (SshConnectionException)exception; Assert.AreEqual(DisconnectReason.ConnectionLost, connectionException.DisconnectReason); var innerException = exception.InnerException; Assert.IsNotNull(innerException); Assert.AreEqual(typeof(SocketException), innerException.GetType()); var socketException = (SocketException)innerException; Assert.AreSame(connectionException.Message, socketException.Message); Assert.AreEqual(SocketError.ConnectionReset, socketException.SocketErrorCode); }
public void ErrorOccurredIsRaisedOnce() { Assert.AreEqual(1, ErrorOccurredRegister.Count, ErrorOccurredRegister.AsString()); var errorOccurred = ErrorOccurredRegister[0]; Assert.IsNotNull(errorOccurred); var exception = errorOccurred.Exception; Assert.IsNotNull(exception); Assert.AreEqual(typeof(SshException), exception.GetType()); var sshException = (SshException)exception; Assert.IsNull(sshException.InnerException); Assert.AreEqual("Message type 255 is not supported.", sshException.Message); }
public void ErrorOccurredIsRaisedOnce() { Assert.AreEqual(1, ErrorOccurredRegister.Count, ErrorOccurredRegister.AsString()); var errorOccurred = ErrorOccurredRegister[0]; Assert.IsNotNull(errorOccurred); var exception = errorOccurred.Exception; Assert.IsNotNull(exception); Assert.AreEqual(typeof(SshConnectionException), exception.GetType()); var connectionException = (SshConnectionException)exception; Assert.AreEqual(DisconnectReason.ConnectionLost, connectionException.DisconnectReason); Assert.IsNull(connectionException.InnerException); Assert.AreEqual("An established connection was aborted by the server.", connectionException.Message); }
public void ErrorOccurredIsRaisedOnce() { Assert.AreEqual(1, ErrorOccurredRegister.Count, ErrorOccurredRegister.AsString()); var errorOccurred = ErrorOccurredRegister[0]; Assert.IsNotNull(errorOccurred); var exception = errorOccurred.Exception; Assert.IsNotNull(exception); Assert.AreEqual(typeof(SshConnectionException), exception.GetType()); var connectionException = (SshConnectionException)exception; Assert.AreEqual(DisconnectReason.ProtocolError, connectionException.DisconnectReason); Assert.IsNull(connectionException.InnerException); Assert.AreEqual("Bad packet length: 168101125.", connectionException.Message); }
public void ErrorOccurredIsNeverRaised() { Assert.AreEqual(0, ErrorOccurredRegister.Count, ErrorOccurredRegister.AsString()); }
public void ErrorOccurredShouldNotBeRaised() { Assert.AreEqual(0, ErrorOccurredRegister.Count, ErrorOccurredRegister.AsString()); }