Exemple #1
0
 protected void Act()
 {
     try
     {
         _connectionInfo.Authenticate(_sessionMock.Object, _serviceFactoryMock.Object);
     }
     catch (SshAuthenticationException ex)
     {
         _actualException = ex;
     }
 }
Exemple #2
0
 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 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.");
        }
Exemple #4
0
        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);
            }
        }
Exemple #6
0
        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);
 }
Exemple #8
0
 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);
 }