Пример #1
0
 public PrivateApiResponse<T> ForcePasswordChangeDiffUser<T>(string companyName, string userName, string userPassword, object content, HttpMethod httpMethod, string contentType = "application/json")
 {
     connection.DeAuthenticate();
     connection.Authenticate(companyName, userName, userPassword);
     string contentString = ConvertToJsonString(content);
     using (LogHelper.LoggerForCurrentTest.EnterReproStep($"Force password change with {ForceEndpoint}"))
     {
         return ProcessResponseWithContent<T>(connection.SendAsync(ForceEndpoint, contentString, httpMethod, contentType).Result);
     }
 }
Пример #2
0
        private void PerformTestWithoutAuthorisation(bool doDeauth, Func <PrivateApiConnection, string, object> responseProvider, string recordId = null)
        {
            var connection = new PrivateApiConnection();

            if (doDeauth)
            {
                connection.Authenticate();
                connection.DeAuthenticate();
            }
            else
            {
                connection = new PrivateApiConnection();
                connection.SuppressAuthentication = true;
            }
            var response = responseProvider(connection, recordId);

            PrAssert.That(response, PrIs.ErrorResponse().And.HttpCode(401));
        }
Пример #3
0
 private void Login(PrivateApiConnection connection, string company, string login, string password)
 {
     connection.DeAuthenticate();
     connection.Authenticate(company, login, password);
 }