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); } }
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)); }
private void Login(PrivateApiConnection connection, string company, string login, string password) { connection.DeAuthenticate(); connection.Authenticate(company, login, password); }