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 11 matching lines...) Expand all Loading... |
22 using System.Net.Http; | 22 using System.Net.Http; |
23 using System.Net.Http.Headers; | 23 using System.Net.Http.Headers; |
24 using System.Text; | 24 using System.Text; |
25 using System.Threading; | 25 using System.Threading; |
26 using System.Threading.Tasks; | 26 using System.Threading.Tasks; |
27 | 27 |
28 using NUnit.Framework; | 28 using NUnit.Framework; |
29 | 29 |
30 using Google.Apis.Http; | 30 using Google.Apis.Http; |
31 using Google.Apis.Util; | 31 using Google.Apis.Util; |
32 using Google.Apis.Testing; | |
33 | 32 |
34 namespace Google.Apis.Tests.Apis.Http | 33 namespace Google.Apis.Tests.Apis.Http |
35 { | 34 { |
36 /// <summary>Tests for <see cref="Google.Apis.Http.ConfigurableMessageHandle
r"/>.</summary> | 35 /// <summary>Tests for <see cref="Google.Apis.Http.ConfigurableMessageHandle
r"/>.</summary> |
37 [TestFixture] | 36 [TestFixture] |
38 public class ConfigurableMessageHandlerTest | 37 public class ConfigurableMessageHandlerTest |
39 { | 38 { |
40 #region Handlers | 39 #region Handlers |
41 | 40 |
42 /// <summary>Unsuccessful handler which always returns <c>true</c>.</sum
mary> | 41 /// <summary>Unsuccessful handler which always returns <c>true</c>.</sum
mary> |
(...skipping 975 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1018 // with application name | 1017 // with application name |
1019 configurableHanlder.ApplicationName = applicationName; | 1018 configurableHanlder.ApplicationName = applicationName; |
1020 request = new HttpRequestMessage(HttpMethod.Get, "https://test-u
ser-agent"); | 1019 request = new HttpRequestMessage(HttpMethod.Get, "https://test-u
ser-agent"); |
1021 response = client.SendAsync(request).Result; | 1020 response = client.SendAsync(request).Result; |
1022 userAgent = string.Join(" ", request.Headers.GetValues("User-Age
nt").ToArray()); | 1021 userAgent = string.Join(" ", request.Headers.GetValues("User-Age
nt").ToArray()); |
1023 Assert.That(userAgent, Is.EqualTo(applicationName + " " + apiVer
sion)); | 1022 Assert.That(userAgent, Is.EqualTo(applicationName + " " + apiVer
sion)); |
1024 } | 1023 } |
1025 } | 1024 } |
1026 } | 1025 } |
1027 } | 1026 } |
OLD | NEW |