diff options
author | crupest <crupest@outlook.com> | 2020-01-19 22:45:43 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2020-01-19 22:45:43 +0800 |
commit | e6069a6980ec6d2505e19026d4c84a9588f153dc (patch) | |
tree | 1fa3969a53138becb76a7eef7bafdafc7046c12c /Timeline.Tests/Controllers/TokenControllerTest.cs | |
parent | c5f3c69b3a008ab87542e523e2a59f37801bd65a (diff) | |
download | timeline-e6069a6980ec6d2505e19026d4c84a9588f153dc.tar.gz timeline-e6069a6980ec6d2505e19026d4c84a9588f153dc.tar.bz2 timeline-e6069a6980ec6d2505e19026d4c84a9588f153dc.zip |
Basically finish refactor of error codes.
Diffstat (limited to 'Timeline.Tests/Controllers/TokenControllerTest.cs')
-rw-r--r-- | Timeline.Tests/Controllers/TokenControllerTest.cs | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/Timeline.Tests/Controllers/TokenControllerTest.cs b/Timeline.Tests/Controllers/TokenControllerTest.cs index 371884bb..2b3547ea 100644 --- a/Timeline.Tests/Controllers/TokenControllerTest.cs +++ b/Timeline.Tests/Controllers/TokenControllerTest.cs @@ -10,7 +10,6 @@ using Timeline.Models.Http; using Timeline.Services;
using Timeline.Tests.Helpers;
using Xunit;
-using static Timeline.ErrorCodes.Token;
namespace Timeline.Tests.Controllers
{
@@ -67,7 +66,7 @@ namespace Timeline.Tests.Controllers });
action.Result.Should().BeAssignableTo<BadRequestObjectResult>()
.Which.Value.Should().BeAssignableTo<CommonResponse>()
- .Which.Code.Should().Be(Create.BadCredential);
+ .Which.Code.Should().Be(ErrorCodes.TokenController.Create_BadCredential);
}
[Fact]
@@ -82,7 +81,7 @@ namespace Timeline.Tests.Controllers });
action.Result.Should().BeAssignableTo<BadRequestObjectResult>()
.Which.Value.Should().BeAssignableTo<CommonResponse>()
- .Which.Code.Should().Be(Create.BadCredential);
+ .Which.Code.Should().Be(ErrorCodes.TokenController.Create_BadCredential);
}
[Fact]
@@ -98,10 +97,10 @@ namespace Timeline.Tests.Controllers public static IEnumerable<object[]> Verify_BadRequest_Data()
{
- yield return new object[] { new JwtVerifyException(JwtVerifyException.ErrorCodes.Expired), Verify.TimeExpired };
- yield return new object[] { new JwtVerifyException(JwtVerifyException.ErrorCodes.IdClaimBadFormat), Verify.BadFormat };
- yield return new object[] { new JwtVerifyException(JwtVerifyException.ErrorCodes.OldVersion), Verify.OldVersion };
- yield return new object[] { new UserNotExistException(), Verify.UserNotExist };
+ yield return new object[] { new JwtVerifyException(JwtVerifyException.ErrorCodes.Expired), ErrorCodes.TokenController.Verify_TimeExpired };
+ yield return new object[] { new JwtVerifyException(JwtVerifyException.ErrorCodes.IdClaimBadFormat), ErrorCodes.TokenController.Verify_BadFormat };
+ yield return new object[] { new JwtVerifyException(JwtVerifyException.ErrorCodes.OldVersion), ErrorCodes.TokenController.Verify_OldVersion };
+ yield return new object[] { new UserNotExistException(), ErrorCodes.TokenController.Verify_UserNotExist };
}
[Theory]
|