public async Task WhenAConnectorIsUpdated(int connectorId) { _scenarioContext.Should().ContainKey("createdChargeStationResponse"); _scenarioContext.Should().ContainKey("createdGroupResponse"); _scenarioContext["createdGroupResponse"].Should().NotBeNull(); _scenarioContext["createdChargeStationResponse"].Should().NotBeNull(); GroupResource groupResponse = await _groupDriver.ParseFromResponse <GroupResource>((HttpResponseMessage)_scenarioContext["createdGroupResponse"]); ChargeStationResource chargeStationResource = await _connectorDriver.ParseFromResponse <ChargeStationResource>((HttpResponseMessage)_scenarioContext["createdChargeStationResponse"]); _scenarioContext["updatedConnector"] = await _connectorDriver.UpdateConnector(groupResponse.Id, chargeStationResource.Id, connectorId, ((SaveConnectorResource)_scenarioContext["createConnector"]).MaxCurrentAmp.Value); }
public async Task ThenShouldUpdateSuccessfullyAllConnectorsToMaxCurrentForAllChargeStations(float maxCurrent) { List <HttpResponseMessage> responses = (List <HttpResponseMessage>)_scenarioContext["chargeStationListResponses"]; GroupResource groupResponse = await _groupDriver.ParseFromResponse <GroupResource>((HttpResponseMessage)_scenarioContext["createdGroupResponse"]); foreach (var response in responses) { ChargeStationResource chargeStationResource = await _chargeStationDriver.ParseFromResponse <ChargeStationResource>(response); var connectorResponse = await _connectorDriver.UpdateConnector(groupResponse.Id, chargeStationResource.Id, 1, maxCurrent); connectorResponse.StatusCode.Should().Be(200); } }