protected void Act() { try { _connectionInfo.Authenticate(_sessionMock.Object, _serviceFactoryMock.Object); } catch (SshAuthenticationException ex) { _actualException = ex; } }
public void AuthenticateTest() { string host = string.Empty; // TODO: Initialize to an appropriate value string username = string.Empty; // TODO: Initialize to an appropriate value AuthenticationMethod[] authenticationMethods = null; // TODO: Initialize to an appropriate value ConnectionInfo target = new ConnectionInfo(host, username, authenticationMethods); // TODO: Initialize to an appropriate value Session session = null; // TODO: Initialize to an appropriate value bool expected = false; // TODO: Initialize to an appropriate value bool actual; actual = target.Authenticate(session); Assert.AreEqual(expected, actual); Assert.Inconclusive("Verify the correctness of this test method."); }
public void AuthenticateShouldThrowArgumentNullExceptionWhenServiceFactoryIsNull() { var connectionInfo = new ConnectionInfo(Resources.HOST, int.Parse(Resources.PORT), Resources.USERNAME, ProxyTypes.None, Resources.HOST, int.Parse(Resources.PORT), Resources.USERNAME, Resources.PASSWORD, new KeyboardInteractiveAuthenticationMethod(Resources.USERNAME)); var session = new Mock <ISession>(MockBehavior.Strict).Object; IServiceFactory serviceFactory = null; try { connectionInfo.Authenticate(session, serviceFactory); Assert.Fail(); } catch (ArgumentNullException ex) { Assert.IsNull(ex.InnerException); Assert.AreEqual("serviceFactory", ex.ParamName); } }
public void AuthenticateShouldThrowArgumentNullExceptionWhenServiceFactoryIsNull() { var connectionInfo = new ConnectionInfo(Resources.HOST, int.Parse(Resources.PORT), Resources.USERNAME, ProxyTypes.None, Resources.HOST, int.Parse(Resources.PORT), Resources.USERNAME, Resources.PASSWORD, new KeyboardInteractiveAuthenticationMethod(Resources.USERNAME)); var session = new Mock<ISession>(MockBehavior.Strict).Object; IServiceFactory serviceFactory = null; try { connectionInfo.Authenticate(session, serviceFactory); Assert.Fail(); } catch (ArgumentNullException ex) { Assert.IsNull(ex.InnerException); Assert.AreEqual("serviceFactory", ex.ParamName); } }
public void Test_ConnectionInfo_Authenticate_Null() { var ret = new ConnectionInfo(Resources.HOST, int.Parse(Resources.PORT), Resources.USERNAME, ProxyTypes.None, Resources.HOST, int.Parse(Resources.PORT), Resources.USERNAME, Resources.PASSWORD, null); ret.Authenticate(null); }
protected void Act() { _connectionInfo.Authenticate(_sessionMock.Object, _serviceFactoryMock.Object); }