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

Side by Side Diff: Src/GoogleApis.Tests/Apis/Services/BaseClientServiceTest.cs

Issue 12566043: Issue 369: Change default behavior of an HTTP request (Closed) Base URL: https://google-api-dotnet-client.googlecode.com/hg/
Patch Set: Miceli review Created 11 years, 1 month ago
Left:
Right:
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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 Copyright 2013 Google Inc 2 Copyright 2013 Google Inc
3 3
4 Licensed under the Apache License, Version 2.0 (the "License"); 4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License. 5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at 6 You may obtain a copy of the License at
7 7
8 http://www.apache.org/licenses/LICENSE-2.0 8 http://www.apache.org/licenses/LICENSE-2.0
9 9
10 Unless required by applicable law or agreed to in writing, software 10 Unless required by applicable law or agreed to in writing, software
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 342
343 [Test] 343 [Test]
344 public void Constructor_DefaultValues() 344 public void Constructor_DefaultValues()
345 { 345 {
346 var service = new MockClientService(new BaseClientService.Initialize r()); 346 var service = new MockClientService(new BaseClientService.Initialize r());
347 Assert.NotNull(service.HttpClient); 347 Assert.NotNull(service.HttpClient);
348 Assert.Null(service.HttpClientInitializer); 348 Assert.Null(service.HttpClientInitializer);
349 Assert.That(service.Authenticator, Is.EqualTo(NullAuthenticator.Inst ance)); 349 Assert.That(service.Authenticator, Is.EqualTo(NullAuthenticator.Inst ance));
350 Assert.True(service.GZipEnabled); 350 Assert.True(service.GZipEnabled);
351 351
352 // back-off handlers are added by default 352 // back-off handler for unsuccessful response (503) is added by defa ult
353 Assert.That(service.HttpClient.MessageHandler.UnsuccessfulResponseHa ndlers.Count, Is.EqualTo(1)); 353 Assert.That(service.HttpClient.MessageHandler.UnsuccessfulResponseHa ndlers.Count, Is.EqualTo(1));
354 Assert.That(service.HttpClient.MessageHandler.UnsuccessfulResponseHa ndlers[0], 354 Assert.That(service.HttpClient.MessageHandler.UnsuccessfulResponseHa ndlers[0],
355 Is.InstanceOf<BackOffHandler>()); 355 Is.InstanceOf<BackOffHandler>());
356 Assert.That(service.HttpClient.MessageHandler.ExceptionHandlers.Coun t, Is.EqualTo(1));
357 Assert.That(service.HttpClient.MessageHandler.ExceptionHandlers[0],
358 Is.InstanceOf<BackOffHandler>());
359 356
360 // one execute interceptor (for adding the "Authenticate" header 357 // one execute interceptor (for adding the "Authenticate" header
361 Assert.That(service.HttpClient.MessageHandler.ExecuteInterceptors.Co unt, Is.EqualTo(1)); 358 Assert.That(service.HttpClient.MessageHandler.ExecuteInterceptors.Co unt, Is.EqualTo(1));
362 Assert.That(service.HttpClient.MessageHandler.ExecuteInterceptors[0] , 359 Assert.That(service.HttpClient.MessageHandler.ExecuteInterceptors[0] ,
363 Is.InstanceOf<AuthenticatorInterceptor>()); 360 Is.InstanceOf<AuthenticatorInterceptor>());
364 } 361 }
365 362
366 #endregion 363 #endregion
367 } 364 }
368 } 365 }
OLDNEW

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