public void testDebugSyncronousWebService() { IWebService service = new DebugSyncronousEditorWebRequest(); WebServiceReturnStatus result = service.request("https://transfluent.com/v2/hello/world"); Assert.AreEqual(result.httpErrorCode, 0); Assert.NotNull(result.text); Assert.Greater(result.text.Length, 0); }
//[Test] public void OneTimeSetup() { var credentials = new FileBasedCredentialProvider(); Assert.False(string.IsNullOrEmpty(credentials.username)); Assert.False(string.IsNullOrEmpty(credentials.password)); var login = new Login(credentials.username, credentials.password); var request = new DebugSyncronousEditorWebRequest(); AuthenticationResponse response = login.Parse(request.request(login).text); accessToken = response.token; if (string.IsNullOrEmpty(accessToken)) { throw new Exception("was not able to log in!"); } getLanguages(); SaveRetrieveKey(TRANSLATION_KEY, englishLanguage); }
//[Test] public void OneTimeSetup() { var credentials = new FileBasedCredentialProvider(); Assert.False(string.IsNullOrEmpty(credentials.username)); Assert.False(string.IsNullOrEmpty(credentials.password)); var login = new Login(credentials.username, credentials.password); var request = new DebugSyncronousEditorWebRequest(); AuthenticationResponse response = login.Parse(request.request(login).text); accessToken = response.token; if(string.IsNullOrEmpty(accessToken)) { throw new Exception("was not able to log in!"); } getLanguages(); SaveRetrieveKey(TRANSLATION_KEY, englishLanguage); }