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 | 5e3e007c28fac571e5bcfa57f371b640342defb7 (patch) | |
tree | 510628773fefe110de4d80eb268d5c5c3e17d998 /Timeline.Tests/Helpers/Authentication/AuthenticationHttpClientExtensions.cs | |
parent | 56c51bdf844ce1e3642dcdc4099187e7e57008c7 (diff) | |
download | timeline-5e3e007c28fac571e5bcfa57f371b640342defb7.tar.gz timeline-5e3e007c28fac571e5bcfa57f371b640342defb7.tar.bz2 timeline-5e3e007c28fac571e5bcfa57f371b640342defb7.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); } } |