| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185 |
- using Microsoft.VisualStudio.TestTools.UnitTesting;
- using Renci.SshNet.Common;
- using Renci.SshNet.Tests.Common;
- using Renci.SshNet.Tests.Properties;
- using System;
- namespace Renci.SshNet.Tests.Classes
- {
- /// <summary>
- /// Provides connection information when keyboard interactive authentication method is used
- /// </summary>
- [TestClass]
- public class KeyboardInteractiveConnectionInfoTest : TestBase
- {
- [TestMethod]
- [TestCategory("KeyboardInteractiveConnectionInfo")]
- public void Test_KeyboardInteractiveConnectionInfo()
- {
- var host = Resources.HOST;
- var username = Resources.USERNAME;
- var password = Resources.PASSWORD;
- #region Example KeyboardInteractiveConnectionInfo AuthenticationPrompt
- var connectionInfo = new KeyboardInteractiveConnectionInfo(host, username);
- connectionInfo.AuthenticationPrompt += delegate(object sender, AuthenticationPromptEventArgs e)
- {
- System.Console.WriteLine(e.Instruction);
- foreach (var prompt in e.Prompts)
- {
- Console.WriteLine(prompt.Request);
- prompt.Response = Console.ReadLine();
- }
- };
- using (var client = new SftpClient(connectionInfo))
- {
- client.Connect();
- // Do something here
- client.Disconnect();
- }
- #endregion
- Assert.AreEqual(connectionInfo.Host, Resources.HOST);
- Assert.AreEqual(connectionInfo.Username, Resources.USERNAME);
- }
- /// <summary>
- ///A test for Dispose
- ///</summary>
- [TestMethod()]
- public void DisposeTest()
- {
- string host = string.Empty; // TODO: Initialize to an appropriate value
- string username = string.Empty; // TODO: Initialize to an appropriate value
- KeyboardInteractiveConnectionInfo target = new KeyboardInteractiveConnectionInfo(host, username); // TODO: Initialize to an appropriate value
- target.Dispose();
- Assert.Inconclusive("A method that does not return a value cannot be verified.");
- }
- /// <summary>
- ///A test for KeyboardInteractiveConnectionInfo Constructor
- ///</summary>
- [TestMethod()]
- public void KeyboardInteractiveConnectionInfoConstructorTest()
- {
- string host = string.Empty; // TODO: Initialize to an appropriate value
- int port = 0; // TODO: Initialize to an appropriate value
- string username = string.Empty; // TODO: Initialize to an appropriate value
- ProxyTypes proxyType = new ProxyTypes(); // TODO: Initialize to an appropriate value
- string proxyHost = string.Empty; // TODO: Initialize to an appropriate value
- int proxyPort = 0; // TODO: Initialize to an appropriate value
- string proxyUsername = string.Empty; // TODO: Initialize to an appropriate value
- string proxyPassword = string.Empty; // TODO: Initialize to an appropriate value
- KeyboardInteractiveConnectionInfo target = new KeyboardInteractiveConnectionInfo(host, port, username, proxyType, proxyHost, proxyPort, proxyUsername, proxyPassword);
- Assert.Inconclusive("TODO: Implement code to verify target");
- }
- /// <summary>
- ///A test for KeyboardInteractiveConnectionInfo Constructor
- ///</summary>
- [TestMethod()]
- public void KeyboardInteractiveConnectionInfoConstructorTest1()
- {
- string host = string.Empty; // TODO: Initialize to an appropriate value
- string username = string.Empty; // TODO: Initialize to an appropriate value
- ProxyTypes proxyType = new ProxyTypes(); // TODO: Initialize to an appropriate value
- string proxyHost = string.Empty; // TODO: Initialize to an appropriate value
- int proxyPort = 0; // TODO: Initialize to an appropriate value
- string proxyUsername = string.Empty; // TODO: Initialize to an appropriate value
- string proxyPassword = string.Empty; // TODO: Initialize to an appropriate value
- KeyboardInteractiveConnectionInfo target = new KeyboardInteractiveConnectionInfo(host, username, proxyType, proxyHost, proxyPort, proxyUsername, proxyPassword);
- Assert.Inconclusive("TODO: Implement code to verify target");
- }
- /// <summary>
- ///A test for KeyboardInteractiveConnectionInfo Constructor
- ///</summary>
- [TestMethod()]
- public void KeyboardInteractiveConnectionInfoConstructorTest2()
- {
- string host = string.Empty; // TODO: Initialize to an appropriate value
- string username = string.Empty; // TODO: Initialize to an appropriate value
- ProxyTypes proxyType = new ProxyTypes(); // TODO: Initialize to an appropriate value
- string proxyHost = string.Empty; // TODO: Initialize to an appropriate value
- int proxyPort = 0; // TODO: Initialize to an appropriate value
- string proxyUsername = string.Empty; // TODO: Initialize to an appropriate value
- KeyboardInteractiveConnectionInfo target = new KeyboardInteractiveConnectionInfo(host, username, proxyType, proxyHost, proxyPort, proxyUsername);
- Assert.Inconclusive("TODO: Implement code to verify target");
- }
- /// <summary>
- ///A test for KeyboardInteractiveConnectionInfo Constructor
- ///</summary>
- [TestMethod()]
- public void KeyboardInteractiveConnectionInfoConstructorTest3()
- {
- string host = string.Empty; // TODO: Initialize to an appropriate value
- string username = string.Empty; // TODO: Initialize to an appropriate value
- ProxyTypes proxyType = new ProxyTypes(); // TODO: Initialize to an appropriate value
- string proxyHost = string.Empty; // TODO: Initialize to an appropriate value
- int proxyPort = 0; // TODO: Initialize to an appropriate value
- KeyboardInteractiveConnectionInfo target = new KeyboardInteractiveConnectionInfo(host, username, proxyType, proxyHost, proxyPort);
- Assert.Inconclusive("TODO: Implement code to verify target");
- }
- /// <summary>
- ///A test for KeyboardInteractiveConnectionInfo Constructor
- ///</summary>
- [TestMethod()]
- public void KeyboardInteractiveConnectionInfoConstructorTest4()
- {
- string host = string.Empty; // TODO: Initialize to an appropriate value
- int port = 0; // TODO: Initialize to an appropriate value
- string username = string.Empty; // TODO: Initialize to an appropriate value
- ProxyTypes proxyType = new ProxyTypes(); // TODO: Initialize to an appropriate value
- string proxyHost = string.Empty; // TODO: Initialize to an appropriate value
- int proxyPort = 0; // TODO: Initialize to an appropriate value
- string proxyUsername = string.Empty; // TODO: Initialize to an appropriate value
- KeyboardInteractiveConnectionInfo target = new KeyboardInteractiveConnectionInfo(host, port, username, proxyType, proxyHost, proxyPort, proxyUsername);
- Assert.Inconclusive("TODO: Implement code to verify target");
- }
- /// <summary>
- ///A test for KeyboardInteractiveConnectionInfo Constructor
- ///</summary>
- [TestMethod()]
- public void KeyboardInteractiveConnectionInfoConstructorTest5()
- {
- string host = string.Empty; // TODO: Initialize to an appropriate value
- int port = 0; // TODO: Initialize to an appropriate value
- string username = string.Empty; // TODO: Initialize to an appropriate value
- ProxyTypes proxyType = new ProxyTypes(); // TODO: Initialize to an appropriate value
- string proxyHost = string.Empty; // TODO: Initialize to an appropriate value
- int proxyPort = 0; // TODO: Initialize to an appropriate value
- KeyboardInteractiveConnectionInfo target = new KeyboardInteractiveConnectionInfo(host, port, username, proxyType, proxyHost, proxyPort);
- Assert.Inconclusive("TODO: Implement code to verify target");
- }
- /// <summary>
- ///A test for KeyboardInteractiveConnectionInfo Constructor
- ///</summary>
- [TestMethod()]
- public void KeyboardInteractiveConnectionInfoConstructorTest6()
- {
- string host = string.Empty; // TODO: Initialize to an appropriate value
- int port = 0; // TODO: Initialize to an appropriate value
- string username = string.Empty; // TODO: Initialize to an appropriate value
- KeyboardInteractiveConnectionInfo target = new KeyboardInteractiveConnectionInfo(host, port, username);
- Assert.Inconclusive("TODO: Implement code to verify target");
- }
- /// <summary>
- ///A test for KeyboardInteractiveConnectionInfo Constructor
- ///</summary>
- [TestMethod()]
- public void KeyboardInteractiveConnectionInfoConstructorTest7()
- {
- string host = string.Empty; // TODO: Initialize to an appropriate value
- string username = string.Empty; // TODO: Initialize to an appropriate value
- KeyboardInteractiveConnectionInfo target = new KeyboardInteractiveConnectionInfo(host, username);
- Assert.Inconclusive("TODO: Implement code to verify target");
- }
- }
- }
|