private void ERCollectionToRelationshipsPairsCleanUp() { var pairsToDelete = scenarioContext.AllERCollectionToRelationshipsPairs().ToList(); for (int i = 0; i < pairsToDelete.Count; i++) { Log.Information("Attempting to delete ER Collection to Relationships pairs from scenario context"); scenarioContext.RemoveERCollectionToRelationshipsPair(pairsToDelete[i]); } }
public async Task ThenValidateTheIMSUserGetsAllRelationshipsAcrossERCollectionsFromTheThERCollection() { restClientUser = "******"; var erCollectionRelationshipsPairs = scenarioContext.AllERCollectionToRelationshipsPairs().ToList(); for (int k = 0; k < erCollectionRelationshipsPairs.Count; k++) { var headers = new List <KeyValuePair <string, string> > { new KeyValuePair <string, string>(PlatformHeaders.ErCollectionId, erCollectionRelationshipsPairs[k].Key) }; Log.Information($"Attempting to get all relationships from ER Collection {erCollectionRelationshipsPairs[k].Key}"); var getAllRelationshipsResponseMsg = await ERService.GetAllRelationships(headers); getAllRelationshipsResponseMsg.Response.StatusCode.Should().Be(HttpStatusCode.OK, $"{restClientUser} user with {_testCfg.ImsScopes} scopes should be able to get all relationships from er collection {erCollectionRelationshipsPairs[k].Key}"); var getAllRelationships = getAllRelationshipsResponseMsg.Result.Data.Select(s => s.ToObject <Relationship>()); getAllRelationships.Should().BeEquivalentTo(erCollectionRelationshipsPairs[k].Value); getAllRelationships.Count().Should().Be(erCollectionRelationshipsPairs[k].Value.Count()); } }
public static void RemoveERCollectionToRelationshipsPair(this ScenarioContext scenarioContext, KeyValuePair <string, List <Relationship> > ERCollectionEntitiesPair) { scenarioContext.AllERCollectionToRelationshipsPairs().Remove(ERCollectionEntitiesPair); }