aboutsummaryrefslogtreecommitdiff
path: root/Timeline.Tests/Helpers/Authentication/AuthenticationHttpClientExtensions.cs
diff options
context:
space:
mode:
author杨宇千 <crupest@outlook.com>2019-04-15 22:25:46 +0800
committerGitHub <noreply@github.com>2019-04-15 22:25:46 +0800
commitae848e311b46a25ec1ed571432d55e800ac7595b (patch)
tree510628773fefe110de4d80eb268d5c5c3e17d998 /Timeline.Tests/Helpers/Authentication/AuthenticationHttpClientExtensions.cs
parent825778f4058d107186be66af05b1f8d16cd1e32c (diff)
parent500b71e094f2ed827f2e85fb6a83a8fb0eaf5d83 (diff)
downloadtimeline-ae848e311b46a25ec1ed571432d55e800ac7595b.tar.gz
timeline-ae848e311b46a25ec1ed571432d55e800ac7595b.tar.bz2
timeline-ae848e311b46a25ec1ed571432d55e800ac7595b.zip
Merge pull request #21 from crupest/verifytoken
Rename ValidateToken to VerifyToken.
Diffstat (limited to 'Timeline.Tests/Helpers/Authentication/AuthenticationHttpClientExtensions.cs')
-rw-r--r--Timeline.Tests/Helpers/Authentication/AuthenticationHttpClientExtensions.cs4
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);
}
}