aboutsummaryrefslogtreecommitdiff
path: root/Timeline.Tests/AuthorizationUnitTest.cs
diff options
context:
space:
mode:
author杨宇千 <crupest@outlook.com>2019-08-11 15:34:59 +0800
committer杨宇千 <crupest@outlook.com>2019-08-11 15:34:59 +0800
commit4d15f7d696825f332884bb23e67760d6d1f5a736 (patch)
tree233518dd41d7747c8932eac67d48a62aa4203d53 /Timeline.Tests/AuthorizationUnitTest.cs
parentd97185e6152a327f6ef3b1873bfd86f1a3aac3a1 (diff)
downloadtimeline-4d15f7d696825f332884bb23e67760d6d1f5a736.tar.gz
timeline-4d15f7d696825f332884bb23e67760d6d1f5a736.tar.bz2
timeline-4d15f7d696825f332884bb23e67760d6d1f5a736.zip
Add FluentAssertions.
Diffstat (limited to 'Timeline.Tests/AuthorizationUnitTest.cs')
-rw-r--r--Timeline.Tests/AuthorizationUnitTest.cs13
1 files changed, 7 insertions, 6 deletions
diff --git a/Timeline.Tests/AuthorizationUnitTest.cs b/Timeline.Tests/AuthorizationUnitTest.cs
index d9fb7406..3df4d0fd 100644
--- a/Timeline.Tests/AuthorizationUnitTest.cs
+++ b/Timeline.Tests/AuthorizationUnitTest.cs
@@ -5,6 +5,7 @@ using Timeline.Tests.Helpers;
using Timeline.Tests.Helpers.Authentication;
using Xunit;
using Xunit.Abstractions;
+using FluentAssertions;
namespace Timeline.Tests
{
@@ -27,7 +28,7 @@ namespace Timeline.Tests
using (var client = _factory.CreateDefaultClient())
{
var response = await client.GetAsync(AuthorizeUrl);
- Assert.Equal(HttpStatusCode.Unauthorized, response.StatusCode);
+ response.Should().HaveStatusCode(HttpStatusCode.Unauthorized);
}
}
@@ -37,7 +38,7 @@ namespace Timeline.Tests
using (var client = await _factory.CreateClientAsUser())
{
var response = await client.GetAsync(AuthorizeUrl);
- Assert.Equal(HttpStatusCode.OK, response.StatusCode);
+ response.Should().HaveStatusCode(HttpStatusCode.OK);
}
}
@@ -47,9 +48,9 @@ namespace Timeline.Tests
using (var client = await _factory.CreateClientAsUser())
{
var response1 = await client.GetAsync(UserUrl);
- Assert.Equal(HttpStatusCode.OK, response1.StatusCode);
+ response1.Should().HaveStatusCode(HttpStatusCode.OK);
var response2 = await client.GetAsync(AdminUrl);
- Assert.Equal(HttpStatusCode.Forbidden, response2.StatusCode);
+ response2.Should().HaveStatusCode(HttpStatusCode.Forbidden);
}
}
@@ -59,9 +60,9 @@ namespace Timeline.Tests
using (var client = await _factory.CreateClientAsAdmin())
{
var response1 = await client.GetAsync(UserUrl);
- Assert.Equal(HttpStatusCode.OK, response1.StatusCode);
+ response1.Should().HaveStatusCode(HttpStatusCode.OK);
var response2 = await client.GetAsync(AdminUrl);
- Assert.Equal(HttpStatusCode.OK, response2.StatusCode);
+ response2.Should().HaveStatusCode(HttpStatusCode.OK);
}
}
}