Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1379)

Unified Diff: Src/GoogleApis.Tests/Apis/Requests/BatchRequestTest.cs

Issue 46460043: Issue 432: Batch request with null callback throws exception (Closed) Base URL: https://google-api-dotnet-client.googlecode.com/hg/
Patch Set: Created 10 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Src/GoogleApis.Tests/Apis/Requests/BatchRequestTest.cs
===================================================================
--- a/Src/GoogleApis.Tests/Apis/Requests/BatchRequestTest.cs
b/Src/GoogleApis.Tests/Apis/Requests/BatchRequestTest.cs
@@ -211,7 211,7 @@
this.successful2ndResponse = successful2ndReponse;
}
- protected override async Task<HttpResponseMessage> SendAsyncCore(HttpRequestMessage request,
protected override Task<HttpResponseMessage> SendAsyncCore(HttpRequestMessage request,
class 2014/01/06 17:06:47 Will this still execute asynchronously?
peleyal 2014/01/06 21:43:13 there isn't a call to await so declaring the metho
class 2014/01/07 00:49:20 ack. On 2014/01/06 21:43:13, peleyal wrote:
CancellationToken cancellationToken)
{
#region Verify Request Message
@@ -237,7 237,9 @@
Encoding.UTF8, "multipart/mixed");
response.Content.Headers.ContentType.Parameters.Add(new NameValueHeaderValue("boundary", boundary));
- return response;
TaskCompletionSource<HttpResponseMessage> tcs = new TaskCompletionSource<HttpResponseMessage>();
tcs.SetResult(response);
return tcs.Task;
}
}
@@ -323,6 325,35 @@
}
[Test]
public void ExecuteAsync_NoCallback_Test()
{
var handler = new BatchMessageHandler(true);
var initializer = new BaseClientService.Initializer()
{
HttpClientFactory = new MockHttpClientFactory(handler)
};
using (var service = new MockClientService(initializer, "http://sample.com"))
{
var responses = new List<Tuple<MockResponse, RequestError, HttpResponseMessage>>();
var batch = new BatchRequest(service);
var request1 = new TestClientServiceRequest(service, new MockRequest
{
ETag = "\"100\"",
Name = "Name1"
});
var request2 = new TestClientServiceRequest(service, new MockRequest
{
ETag = "\"200\"",
Name = "Name1-1"
});
batch.Queue<MockResponse>(request1, null);
batch.Queue<MockResponse>(request2, null);
batch.ExecuteAsync().Wait();
}
}
[Test]
public void CreateOuterRequestContent_Test()
{
using (var service = new MockClientService("http://sample.com"))
« no previous file with comments | « no previous file | Src/GoogleApis.Tests/GoogleApis.Tests.csproj » ('j') | Src/GoogleApis.Tests/GoogleApis.Tests.csproj » ('J')

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b