diff options
author | crupest <crupest@outlook.com> | 2019-04-15 22:06:58 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2019-04-15 22:06:58 +0800 |
commit | 500b71e094f2ed827f2e85fb6a83a8fb0eaf5d83 (patch) | |
tree | 510628773fefe110de4d80eb268d5c5c3e17d998 /Timeline.Tests/Helpers/Authentication/AuthenticationHttpClientExtensions.cs | |
parent | 825778f4058d107186be66af05b1f8d16cd1e32c (diff) | |
download | timeline-500b71e094f2ed827f2e85fb6a83a8fb0eaf5d83.tar.gz timeline-500b71e094f2ed827f2e85fb6a83a8fb0eaf5d83.tar.bz2 timeline-500b71e094f2ed827f2e85fb6a83a8fb0eaf5d83.zip |
Rename ValidateToken to VerifyToken.
Diffstat (limited to 'Timeline.Tests/Helpers/Authentication/AuthenticationHttpClientExtensions.cs')
-rw-r--r-- | Timeline.Tests/Helpers/Authentication/AuthenticationHttpClientExtensions.cs | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/Timeline.Tests/Helpers/Authentication/AuthenticationHttpClientExtensions.cs b/Timeline.Tests/Helpers/Authentication/AuthenticationHttpClientExtensions.cs index 1949df9b..c0051c53 100644 --- a/Timeline.Tests/Helpers/Authentication/AuthenticationHttpClientExtensions.cs +++ b/Timeline.Tests/Helpers/Authentication/AuthenticationHttpClientExtensions.cs @@ -15,11 +15,9 @@ namespace Timeline.Tests.Helpers.Authentication public static async Task<CreateTokenResponse> CreateUserTokenAsync(this HttpClient client, string username, string password, bool assertSuccess = true) { var response = await client.PostAsJsonAsync(CreateTokenUrl, new CreateTokenRequest { Username = username, Password = password }); - Assert.Equal(HttpStatusCode.OK, response.StatusCode); var result = JsonConvert.DeserializeObject<CreateTokenResponse>(await response.Content.ReadAsStringAsync()); - if (assertSuccess) Assert.True(result.Success); @@ -33,9 +31,7 @@ namespace Timeline.Tests.Helpers.Authentication RequestUri = new Uri(client.BaseAddress, path), }; request.Headers.Add("Authorization", "Bearer " + token); - requestBuilder?.Invoke(request); - return await client.SendAsync(request); } } |