예제 #1
0
 private bool TestChorusAccount(ChorusAccount chorusAccount)
 {
     using (ChorusSession chorusSession = new ChorusSession(chorusAccount))
     {
         try
         {
             CookieContainer cookieContainer = new CookieContainer();
             try
             {
                 chorusSession.Login(chorusAccount, cookieContainer);
                 MessageDlg.Show(this, Resources.EditChorusAccountDlg_TestSettings_Settings_are_correct);
                 return(true);
             }
             catch (RemoteServerException chorusException)
             {
                 MessageDlg.ShowException(this, chorusException);
                 textPassword.Focus();
                 return(false);
             }
         }
         catch (Exception x)
         {
             MessageDlg.ShowWithException(this, Resources.EditChorusAccountDlg_TestSettings_Error_connecting_to_server__ + x.Message, x);
             textServerURL.Focus();
             return(false);
         }
     }
 }
        public bool TestSettings()
        {
            if (!ValidateValues())
            {
                return(false);
            }
            ChorusAccount chorusAccount = GetChorusAccount();
            ChorusSession chorusSession = new ChorusSession();

            try
            {
                CookieContainer cookieContainer = new CookieContainer();
                try
                {
                    chorusSession.Login(chorusAccount, cookieContainer);
                    MessageDlg.Show(this, Resources.EditChorusAccountDlg_TestSettings_Settings_are_correct);
                    return(true);
                }
                catch (ChorusServerException chorusException)
                {
                    MessageDlg.ShowException(this, chorusException);
                    textPassword.Focus();
                    return(false);
                }
            }
            catch (Exception x)
            {
                MessageDlg.ShowWithException(this, Resources.EditChorusAccountDlg_TestSettings_Error_connecting_to_server__ + x.Message, x);
                textServerURL.Focus();
                return(false);
            }
        }
예제 #3
0
        //[TestMethod]
        public void TestAuthenticate()
        {
            CookieContainer cookieContainer = new CookieContainer();
            ChorusSession   chorusSession   = new ChorusSession();

            Assert.AreEqual(0, cookieContainer.Count);
            chorusSession.Login(TEST_ACCOUNT, cookieContainer);
            Assert.AreEqual(1, cookieContainer.Count);
        }
예제 #4
0
 public bool TestSettings()
 {
     if (!ValidateValues())
     {
         return false;
     }
     ChorusAccount chorusAccount = GetChorusAccount();
     ChorusSession chorusSession = new ChorusSession();
     try
     {
         CookieContainer cookieContainer = new CookieContainer();
         try
         {
             chorusSession.Login(chorusAccount, cookieContainer);
             MessageDlg.Show(this, Resources.EditChorusAccountDlg_TestSettings_Settings_are_correct);
             return true;
         }
         catch (ChorusServerException chorusException)
         {
             MessageDlg.ShowException(this, chorusException);
             textPassword.Focus();
             return false;
         }
     }
     catch (Exception x)
     {
         MessageDlg.ShowWithException(this, Resources.EditChorusAccountDlg_TestSettings_Error_connecting_to_server__ + x.Message, x);
         textServerURL.Focus();
         return false;
     }
 }