public void ThenValidateTheIMSUSerGetsNotFoundError(HttpStatusCode respCode) { var getAllResponse = scenarioContext.AllHttpResponses().ToList(); for (int i = 0; i < getAllResponse.Count; i++) { getAllResponse[i].Response.StatusCode.Should().Be(respCode, $"{restClientUser} user with {_testCfg.ImsScopes} scopes should not be able to get new entity"); } }
private void HttpResponsesCleanUp() { var httpResponsesToDelete = scenarioContext.AllHttpResponses().ToList(); for (int i = 0; i < httpResponsesToDelete.Count; i++) { Log.Information("Attempting to delete rest client exception errors from scenario context"); scenarioContext.RemoveHttpResponse(httpResponsesToDelete[i]); } }
public void ThenValidateTheIMSUserGetsEntitiesOfASpecificEntityTypeWithOkStatusCodeFromTheERCollection(int expectedFetchCount, HttpStatusCode responseCode) { var getAllResponses = scenarioContext.AllHttpResponses().ToList(); for (int j = 0; j < getAllResponses.Count; j++) { getAllResponses[j].Response.StatusCode.Should().Be(responseCode, $"{restClientUser} user with {_testCfg.ImsScopes} scopes should not be able to get all entities of entity type which does not have any Entity"); var getAllEntities = getAllResponses[j].Result.Data.Select(s => s.ToObject <Entity>()); getAllEntities.Count().Should().Be(expectedFetchCount); } }
public static void RemoveHttpResponse(this ScenarioContext scenarioContext, RestClientResponse <PlatformCollectionResponse> response) { scenarioContext.AllHttpResponses().Remove(response); }