public void ThenValidateTheIMSUserGetPreconditionFailedErrorCodeForThePostS(HttpStatusCode errorCode) { var getAllResponseErrors = scenarioContext.AllRestClientExceptionErrors().ToList(); for (int i = 0; i < getAllResponseErrors.Count; i++) { getAllResponseErrors[i].Response.StatusCode.Should().Be(errorCode, $"{restClientUser} user with {_testCfg.ImsScopes} scopes should not be able to post a new relationship without required value"); } }
public void ThenValidateTheIMSUserErrorCodeForThePost(HttpStatusCode errorCode) { var getAllResponseErrors = scenarioContext.AllRestClientExceptionErrors().ToList(); for (int i = 0; i < getAllResponseErrors.Count; i++) { getAllResponseErrors[i].Response.StatusCode.Should().Be(errorCode, $"{restClientUser} user with {_testCfg.ImsScopes} scopes should not be able to post a new entity"); } }
private void RestClientExceptionErrorsCleanUp() { var restClientExceptionErrorsToDelete = scenarioContext.AllRestClientExceptionErrors().ToList(); for (int i = 0; i < restClientExceptionErrorsToDelete.Count; i++) { Log.Information("Attempting to delete rest client exception errors from scenario context"); scenarioContext.RemoveRestClientExceptionErrors(restClientExceptionErrorsToDelete[i]); } }
public static void RemoveRestClientExceptionErrors(this ScenarioContext scenarioContext, RestClientException response) { scenarioContext.AllRestClientExceptionErrors().Remove(response); }