public void FormatWithTelnetConnection()
        {
            InMemoryHostPwEntry pwEntry = new InMemoryHostPwEntry()
            {
                Username  = "******",
                Password  = "******",
                IPAddress = "127.0.0.1"
            };

            pwEntry.ConnectionMethods.Add(ConnectionMethodType.PuttyTelnet);

            FakePuttySessionFinder sessionFinder = new FakePuttySessionFinder();

            PuttyArgumentsFormatter argumentsFormatter = new PuttyArgumentsFormatter("putty.exe", sessionFinder, true);

            Assert.AreEqual("\"putty.exe\" -telnet [email protected]", argumentsFormatter.Format(pwEntry));
        }
        public void FormatWithSSHConnectionAndSessionNotFound()
        {
            InMemoryHostPwEntry pwEntry = new InMemoryHostPwEntry()
            {
                Username          = "******",
                Password          = "******",
                IPAddress         = "127.0.0.1",
                AdditionalOptions = "session:MySession1"
            };

            pwEntry.ConnectionMethods.Add(ConnectionMethodType.PuttySSH);

            FakePuttySessionFinder sessionFinder = new FakePuttySessionFinder();

            PuttyArgumentsFormatter argumentsFormatter = new PuttyArgumentsFormatter("putty.exe", sessionFinder, true);

            Assert.AreEqual("\"putty.exe\" -ssh [email protected] -pw \"12345678\"", argumentsFormatter.Format(pwEntry));
        }
Example #3
0
        public void FormatWithSSHConnectionAndOverrideDefaultPort()
        {
            InMemoryHostPwEntry pwEntry = new InMemoryHostPwEntry()
            {
                Username          = "******",
                Password          = "******",
                IPAddress         = "127.0.0.1",
                AdditionalOptions = "session:MySession1;port:50000"
            };

            pwEntry.ConnectionMethods.Add(ConnectionMethodType.PuttySSH);
            FakePuttySessionFinder sessionFinder = new FakePuttySessionFinder();

            sessionFinder.Sessions.Add("MySession");

            PuttyArgumentsFormatter argumentsFormatter = new PuttyArgumentsFormatter("putty.exe", sessionFinder);

            Assert.AreEqual("\"putty.exe\" -load \"MySession\" -P 50000 -ssh [email protected] -pw \"12345678\"", argumentsFormatter.Format(pwEntry));
        }