LEFT | RIGHT |
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 |
11 distributed under the License is distributed on an "AS IS" BASIS, | 11 distributed under the License is distributed on an "AS IS" BASIS, |
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
13 See the License for the specific language governing permissions and | 13 See the License for the specific language governing permissions and |
14 limitations under the License. | 14 limitations under the License. |
15 */ | 15 */ |
16 | 16 |
17 using System; | 17 using System; |
18 using System.Collections.Generic; | 18 using System.Collections.Generic; |
19 using System.Linq; | 19 using System.Linq; |
20 using System.Net.Http; | 20 using System.Net.Http; |
21 using System.Net.Http.Headers; | 21 using System.Net.Http.Headers; |
22 using System.Text; | 22 using System.Text; |
23 using System.Threading; | 23 using System.Threading; |
24 using System.Threading.Tasks; | 24 using System.Threading.Tasks; |
25 | 25 |
26 using NUnit.Framework; | 26 using NUnit.Framework; |
27 | 27 |
28 using Google.Apis.Http; | 28 using Google.Apis.Http; |
29 using Google.Apis.Testing; | 29 using Google.Apis.Tests; |
30 using Google.Apis.Tests._Mock_; | |
31 | 30 |
32 namespace Google.Apis.Tests.Apis.Http | 31 namespace Google.Apis.Tests.Apis.Http |
33 { | 32 { |
34 /// <summary> | 33 /// <summary> |
35 /// Tests for <seealso cref="MaxUrlLengthInterceptor"/>.· | 34 /// Tests for <seealso cref="MaxUrlLengthInterceptor"/>.· |
36 /// For the default case, <see cref="BaseClientServiceTest.TestGetWithUrlToo
LongByDefault"/>. | 35 /// For the default case, <see cref="BaseClientServiceTest.TestGetWithUrlToo
LongByDefault"/>. |
37 /// </summary> | 36 /// </summary> |
38 class MaxUrlLengthInterceptorTest | 37 class MaxUrlLengthInterceptorTest |
39 { | 38 { |
40 private const uint DefaultMaxUrlLength = 2048; | 39 private const uint DefaultMaxUrlLength = 2048; |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 Assert.That(request.Method, Is.EqualTo(HttpMethod.Post)); | 111 Assert.That(request.Method, Is.EqualTo(HttpMethod.Post)); |
113 Assert.That(request.Headers.GetValues("X-HTTP-Method-Override").
Single(), Is.EqualTo("GET")); | 112 Assert.That(request.Headers.GetValues("X-HTTP-Method-Override").
Single(), Is.EqualTo("GET")); |
114 Assert.That(request.Content.Headers.ContentType, | 113 Assert.That(request.Content.Headers.ContentType, |
115 Is.EqualTo(new MediaTypeHeaderValue("application/x-www-form-
urlencoded"))); | 114 Is.EqualTo(new MediaTypeHeaderValue("application/x-www-form-
urlencoded"))); |
116 Assert.That(request.RequestUri, Is.EqualTo(new Uri(uri))); | 115 Assert.That(request.RequestUri, Is.EqualTo(new Uri(uri))); |
117 Assert.That(mockHandler.RequestContent, Is.EqualTo(query)); | 116 Assert.That(mockHandler.RequestContent, Is.EqualTo(query)); |
118 } | 117 } |
119 } | 118 } |
120 } | 119 } |
121 } | 120 } |
LEFT | RIGHT |