OLD | NEW |
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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 } | 77 } |
78 | 78 |
79 private IClientService CreateClientService(DiscoveryVersion version) | 79 private IClientService CreateClientService(DiscoveryVersion version) |
80 { | 80 { |
81 var client = new MockClientService(); | 81 var client = new MockClientService(); |
82 if (version == DiscoveryVersion.Version_0_3) | 82 if (version == DiscoveryVersion.Version_0_3) |
83 client.SetFeatures(new[] { Features.LegacyDataResponse.GetString
Value() }); | 83 client.SetFeatures(new[] { Features.LegacyDataResponse.GetString
Value() }); |
84 return client; | 84 return client; |
85 } | 85 } |
86 | 86 |
87 /// <summary> This tests the v0.3 Deserialization of the BaseService. </
summary> | 87 /// <summary> This tests the v0.3 deserialization of the BaseService. </
summary> |
88 [Test] | 88 [Test] |
89 public void TestDeserializationV0_3() | 89 public void TestDeserializationV0_3() |
90 { | 90 { |
91 const string ResponseV0_3 = | 91 const string ResponseV0_3 = |
92 @"{ ""data"" :· | 92 @"{ ""data"" :· |
93 { | 93 { |
94 ""kind"": ""urlshortener#url"", | 94 ""kind"": ""urlshortener#url"", |
95 ""longUrl"": ""http://google.com/"", | 95 ""longUrl"": ""http://google.com/"", |
96 }· | 96 }· |
97 }"; | 97 }"; |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 | 351 |
352 // one execute interceptor (for adding the "Authenticate" header | 352 // one execute interceptor (for adding the "Authenticate" header |
353 Assert.That(service.HttpClient.MessageHandler.ExecuteInterceptors.Co
unt, Is.EqualTo(1)); | 353 Assert.That(service.HttpClient.MessageHandler.ExecuteInterceptors.Co
unt, Is.EqualTo(1)); |
354 Assert.That(service.HttpClient.MessageHandler.ExecuteInterceptors[0]
, | 354 Assert.That(service.HttpClient.MessageHandler.ExecuteInterceptors[0]
, |
355 Is.InstanceOf<AuthenticatorInterceptor>()); | 355 Is.InstanceOf<AuthenticatorInterceptor>()); |
356 } | 356 } |
357 | 357 |
358 #endregion | 358 #endregion |
359 } | 359 } |
360 } | 360 } |
OLD | NEW |