aboutsummaryrefslogtreecommitdiff
path: root/Timeline.Tests/Helpers/Authentication/AuthenticationExtensions.cs
diff options
context:
space:
mode:
author杨宇千 <crupest@outlook.com>2019-10-17 20:46:57 +0800
committer杨宇千 <crupest@outlook.com>2019-10-17 20:46:57 +0800
commitdef8e8dd78812c019a0d6e8e5a3e2de4e82ae3e4 (patch)
treedc7688d7d2dd5ab28a7e3c553154ee84676f75d2 /Timeline.Tests/Helpers/Authentication/AuthenticationExtensions.cs
parent297d0c9029360f1d5334ed843b9b299356740ec1 (diff)
downloadtimeline-def8e8dd78812c019a0d6e8e5a3e2de4e82ae3e4.tar.gz
timeline-def8e8dd78812c019a0d6e8e5a3e2de4e82ae3e4.tar.bz2
timeline-def8e8dd78812c019a0d6e8e5a3e2de4e82ae3e4.zip
...
Diffstat (limited to 'Timeline.Tests/Helpers/Authentication/AuthenticationExtensions.cs')
-rw-r--r--Timeline.Tests/Helpers/Authentication/AuthenticationExtensions.cs6
1 files changed, 3 insertions, 3 deletions
diff --git a/Timeline.Tests/Helpers/Authentication/AuthenticationExtensions.cs b/Timeline.Tests/Helpers/Authentication/AuthenticationExtensions.cs
index c8a79e58..d068a08a 100644
--- a/Timeline.Tests/Helpers/Authentication/AuthenticationExtensions.cs
+++ b/Timeline.Tests/Helpers/Authentication/AuthenticationExtensions.cs
@@ -13,7 +13,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 });
+ var response = await client.PostAsJsonAsync(CreateTokenUrl, new CreateTokenRequest { Username = username, Password = password, Expire = expireOffset });
response.Should().HaveStatusCodeOk();
var result = JsonConvert.DeserializeObject<CreateTokenResponse>(await response.Content.ReadAsStringAsync());
return result;
@@ -29,12 +29,12 @@ namespace Timeline.Tests.Helpers.Authentication
public static Task<HttpClient> CreateClientAsUser<T>(this WebApplicationFactory<T> factory) where T : class
{
- return factory.CreateClientWithCredential(MockUsers.UserUsername, MockUsers.UserPassword);
+ return factory.CreateClientWithCredential(MockUser.User.Username, MockUser.User.Password);
}
public static Task<HttpClient> CreateClientAsAdmin<T>(this WebApplicationFactory<T> factory) where T : class
{
- return factory.CreateClientWithCredential(MockUsers.AdminUsername, MockUsers.AdminPassword);
+ return factory.CreateClientWithCredential(MockUser.Admin.Username, MockUser.Admin.Password);
}
}
}