aboutsummaryrefslogtreecommitdiff
path: root/Timeline.Tests/AuthorizationUnitTest.cs
diff options
context:
space:
mode:
author杨宇千 <crupest@outlook.com>2019-08-04 14:47:17 +0800
committer杨宇千 <crupest@outlook.com>2019-08-04 14:47:17 +0800
commit13f0a95397751783ac0b4dcfa4d8f1b7112de04c (patch)
tree049034077f7852e8c93d9f4e66dda91de53c8d92 /Timeline.Tests/AuthorizationUnitTest.cs
parentfee9960f936cf996c3afb15d6c7d6dd72637122d (diff)
downloadtimeline-13f0a95397751783ac0b4dcfa4d8f1b7112de04c.tar.gz
timeline-13f0a95397751783ac0b4dcfa4d8f1b7112de04c.tar.bz2
timeline-13f0a95397751783ac0b4dcfa4d8f1b7112de04c.zip
Clean codes.
Diffstat (limited to 'Timeline.Tests/AuthorizationUnitTest.cs')
-rw-r--r--Timeline.Tests/AuthorizationUnitTest.cs7
1 files changed, 3 insertions, 4 deletions
diff --git a/Timeline.Tests/AuthorizationUnitTest.cs b/Timeline.Tests/AuthorizationUnitTest.cs
index ee3deac8..1f707f15 100644
--- a/Timeline.Tests/AuthorizationUnitTest.cs
+++ b/Timeline.Tests/AuthorizationUnitTest.cs
@@ -44,12 +44,11 @@ namespace Timeline.Tests
[Fact]
public async Task UserAuthorizationTest()
{
- using (var client = _factory.CreateDefaultClient())
+ using (var client = await _factory.CreateClientWithUser("user", "user"))
{
- var token = (await client.CreateUserTokenAsync("user", "user")).Token;
- var response1 = await client.SendWithAuthenticationAsync(token, UserUrl);
+ var response1 = await client.GetAsync(UserUrl);
Assert.Equal(HttpStatusCode.OK, response1.StatusCode);
- var response2 = await client.SendWithAuthenticationAsync(token, AdminUrl);
+ var response2 = await client.GetAsync(AdminUrl);
Assert.Equal(HttpStatusCode.Forbidden, response2.StatusCode);
}
}