public async void ForAll_ReturnsValidResponse(SynchronizationTypeParameter parameter) { var response = await _client.SyncAsync(TestVariables.SpaceValid, parameter); response.ShouldNotBeNull(); response.Error.ShouldBeNull(); }
public async Task<SynchronizationResponse> SyncAsync(string spaceId, SynchronizationTypeParameter synchronizationType) { var type = Enum.GetName(typeof (SynchronizationTypeParameter), synchronizationType); if (string.IsNullOrEmpty(type)) { throw new ArgumentException("Unable to parse synchronizationType", "synchronizationType"); } if (synchronizationType == SynchronizationTypeParameter.All) { // For some reason "all" parameter is lowercase but others are uppercase // See https://www.contentful.com/developers/docs/references/content-delivery-api/#/reference/synchronization type = "all"; } var requestUri = string.Format("spaces/{0}/sync?type={1}&initial=true", spaceId, type); return await GetSyncAsync(requestUri); }