当前位置: 首页>>代码示例>>C#>>正文


C# ConnectionInfo.Authenticate方法代码示例

本文整理汇总了C#中ConnectionInfo.Authenticate方法的典型用法代码示例。如果您正苦于以下问题:C# ConnectionInfo.Authenticate方法的具体用法?C# ConnectionInfo.Authenticate怎么用?C# ConnectionInfo.Authenticate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ConnectionInfo的用法示例。


在下文中一共展示了ConnectionInfo.Authenticate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AuthenticateTest

 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.");
 }
开发者ID:pecegit,项目名称:sshnet,代码行数:13,代码来源:ConnectionInfoTest.cs

示例2: AuthenticateShouldThrowArgumentNullExceptionWhenServiceFactoryIsNull

        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);
            }
        }
开发者ID:REALTOBIZ,项目名称:SSH.NET,代码行数:19,代码来源:ConnectionInfoTest.cs

示例3: Test_ConnectionInfo_Authenticate_Null

 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);
 }
开发者ID:pecegit,项目名称:sshnet,代码行数:5,代码来源:ConnectionInfoTest.cs


注:本文中的ConnectionInfo.Authenticate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。