diff options
author | 杨宇千 <crupest@outlook.com> | 2019-08-04 14:47:17 +0800 |
---|---|---|
committer | 杨宇千 <crupest@outlook.com> | 2019-08-04 14:47:17 +0800 |
commit | c1586e28e44835b3636fb63e31f613de4a30bc1e (patch) | |
tree | 049034077f7852e8c93d9f4e66dda91de53c8d92 /Timeline.Tests/Helpers/Authentication/AuthenticationExtensions.cs | |
parent | bdf65726cf3c8efa6470d199d775f36801ecff79 (diff) | |
download | timeline-c1586e28e44835b3636fb63e31f613de4a30bc1e.tar.gz timeline-c1586e28e44835b3636fb63e31f613de4a30bc1e.tar.bz2 timeline-c1586e28e44835b3636fb63e31f613de4a30bc1e.zip |
Clean codes.
Diffstat (limited to 'Timeline.Tests/Helpers/Authentication/AuthenticationExtensions.cs')
-rw-r--r-- | Timeline.Tests/Helpers/Authentication/AuthenticationExtensions.cs | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/Timeline.Tests/Helpers/Authentication/AuthenticationExtensions.cs b/Timeline.Tests/Helpers/Authentication/AuthenticationExtensions.cs index f4e2e45a..03fb9714 100644 --- a/Timeline.Tests/Helpers/Authentication/AuthenticationExtensions.cs +++ b/Timeline.Tests/Helpers/Authentication/AuthenticationExtensions.cs @@ -1,6 +1,5 @@ using Microsoft.AspNetCore.Mvc.Testing; using Newtonsoft.Json; -using System; using System.Net.Http; using System.Threading.Tasks; using Timeline.Entities.Http; @@ -25,16 +24,5 @@ namespace Timeline.Tests.Helpers.Authentication client.DefaultRequestHeaders.Add("Authorization", "Bearer " + token); return client; } - - public static async Task<HttpResponseMessage> SendWithAuthenticationAsync(this HttpClient client, string token, string path, Action<HttpRequestMessage> requestBuilder = null) - { - var request = new HttpRequestMessage - { - RequestUri = new Uri(client.BaseAddress, path), - }; - request.Headers.Add("Authorization", "Bearer " + token); - requestBuilder?.Invoke(request); - return await client.SendAsync(request); - } } } |