ALMRestClient.ALMClient.Login C# (CSharp) Method

Login() public method

Call this before calling other methods - will throw an ALMClientException on failure
public Login ( ) : bool
return bool
        public bool Login()
        {
            IRestRequest request = new RestRequest(clientConfig.LoginAddress);

            CleanRequest(ref request);

            IRestResponse response = client.Execute(request);

            if (response.StatusCode != HttpStatusCode.OK)
            {
                ThrowExceptionIfNecessary(response, "Login");
            }

            SetTokenFromCookies(client);

            return response.StatusCode == HttpStatusCode.OK;
        }

Usage Example

 public void LoginTest()
 {
     Assert.IsTrue(wrapper.Login());
 }