ALMRestClient.ALMClient.IsAuthenticated C# (CSharp) Method

IsAuthenticated() public method

Checks whether the user is currently authenticated
public IsAuthenticated ( ) : bool
return bool
        public bool IsAuthenticated()
        {
            RestSharp.IRestRequest isAuthenticated = new RestSharp.RestRequest(clientConfig.IsAuthenticatedAddress);

            CleanRequest(ref isAuthenticated);

            RestSharp.IRestResponse response = client.Execute(isAuthenticated);

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

            return response.StatusCode == HttpStatusCode.OK;
        }

Usage Example

 public void IsAuthenticatedTest_False()
 {
     Assert.IsFalse(wrapper.IsAuthenticated());
 }