aboutsummaryrefslogtreecommitdiff
path: root/Timeline.Tests/Helpers/Authentication
diff options
context:
space:
mode:
author杨宇千 <crupest@outlook.com>2019-08-09 15:39:58 +0800
committer杨宇千 <crupest@outlook.com>2019-08-09 15:39:58 +0800
commit58986da4a5bfe519af44e5834edfbe8d4651b51c (patch)
tree26432b04bb7b2b2f59b3e8170f2e37cd5ce08c57 /Timeline.Tests/Helpers/Authentication
parent6c50630c4d6576446fc2338714feaefbf28c4ed1 (diff)
downloadtimeline-58986da4a5bfe519af44e5834edfbe8d4651b51c.tar.gz
timeline-58986da4a5bfe519af44e5834edfbe8d4651b51c.tar.bz2
timeline-58986da4a5bfe519af44e5834edfbe8d4651b51c.zip
Add UserController unit tests.
Diffstat (limited to 'Timeline.Tests/Helpers/Authentication')
-rw-r--r--Timeline.Tests/Helpers/Authentication/AuthenticationExtensions.cs1
1 files changed, 1 insertions, 0 deletions
diff --git a/Timeline.Tests/Helpers/Authentication/AuthenticationExtensions.cs b/Timeline.Tests/Helpers/Authentication/AuthenticationExtensions.cs
index e31bd51c..8a44c852 100644
--- a/Timeline.Tests/Helpers/Authentication/AuthenticationExtensions.cs
+++ b/Timeline.Tests/Helpers/Authentication/AuthenticationExtensions.cs
@@ -14,6 +14,7 @@ namespace Timeline.Tests.Helpers.Authentication
public static async Task<CreateTokenResponse> CreateUserTokenAsync(this HttpClient client, string username, string password, int? expireOffset = null)
{
var response = await client.PostAsJsonAsync(CreateTokenUrl, new CreateTokenRequest { Username = username, Password = password, ExpireOffset = expireOffset });
+ response.AssertOk();
var result = JsonConvert.DeserializeObject<CreateTokenResponse>(await response.Content.ReadAsStringAsync());
return result;
}