예제 #1
0
 public void ConnectODSWrongAuth()
 {
     LoginData login = new LoginData(DefaultLoginData);
     login.Password = login.Password + "foobar"; //arbitrary pw modification
     try
     {
         Shell.Execute(SimpleConnectCommand(login));
         Assert.True(false, "Login seemed to work with wrong password!");
     }
     catch (CmdletInvocationException exception)
     {
         var realException = exception.InnerException as RequestFailedException;
         Assert.IsNotNull(realException, "Wrong exception thrown for failed login");
         Assert.True(realException.Message.Contains("Error Code: 2"),
             String.Format("Wrong error for failed login: {0}", realException.Message));
     }
 }
예제 #2
0
 // General helper stuff
 internal string SimpleConnectCommand(LoginData login)
 {
     return String.Join(" ", new string[] {
         CmdletName(typeof(ConnectODSCommand)),
         "-Host",
         SingleQuote(login.URL),
         "-Username",
         SingleQuote(login.UserName),
         "-Password",
         SingleQuote(login.Password)
     });
 }
예제 #3
0
 public LoginData(LoginData login)
 {
     URL = login.URL;
     UserName = login.UserName;
     Password = login.Password;
 }
예제 #4
0
 public LoginData(LoginData login)
 {
     URL      = login.URL;
     UserName = login.UserName;
     Password = login.Password;
 }