本文整理汇总了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.");
}
示例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);
}
}
示例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);
}