public void PatchTableService() { var response = new HttpResponseMessage(HttpStatusCode.OK) { Content = new StringContent(ExpectedResults.TableServiceGetResponse) }; var handler = new RecordedDelegatingHandler(response) { StatusCodeToReturn = HttpStatusCode.OK }; var subscriptionId = Guid.NewGuid().ToString(); var token = new TokenCloudCredentials(subscriptionId, Constants.TokenString); var client = GetClient(handler, token); var settings = new TableServiceWritableSettings { FrontEndCallbackThreadsCount = 100 }; var patchParam = new TableServicePatchParameters { TableService = new TableServiceRequest() { Settings = settings } }; var result = client.TableService.Patch( Constants.ResourceGroupName, Constants.FarmId, patchParam); // validate requestor Assert.Equal(handler.Method.Method, "PATCH", StringComparer.OrdinalIgnoreCase); var expectedUri = string.Format( TableServiceUriTemplate, Constants.BaseUri, subscriptionId, Constants.ResourceGroupName, Constants.FarmId); Assert.Equal(handler.Uri.AbsoluteUri, expectedUri); CompareExpectedResult(result.Resource.TableService); }
public void PatchTableService() { var response = new HttpResponseMessage(HttpStatusCode.OK) { Content = new StringContent(ExpectedResults.TableServiceGetResponse) }; var handler = new RecordedDelegatingHandler(response) { StatusCodeToReturn = HttpStatusCode.OK }; var subscriptionId = Guid.NewGuid().ToString(); var token = new TokenCloudCredentials(subscriptionId, Constants.TokenString); var client = GetClient(handler, token); var settings = new TableServiceWritableSettings { FrontEndCallbackThreadsCount = 100 }; var patchParam = new TableServicePatchParameters { TableService = new TableServiceRequest() { Settings = settings } }; var result = client.TableService.Patch( Constants.ResourceGroupName, Constants.FarmId, patchParam); // validate requestor Assert.Equal(handler.Method.Method, "PATCH", StringComparer.OrdinalIgnoreCase); var expectedUri = string.Format( TableServiceUriTemplate, Constants.BaseUri, subscriptionId, Constants.ResourceGroupName, Constants.FarmId); Assert.Equal(handler.Uri.AbsoluteUri, expectedUri); CompareExpectedResult(result.Resource.TableService); }