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 | 40eea04e1ec9b71c5215e9dce5a6963ea60cafaa (patch) | |
tree | 1fa3969a53138becb76a7eef7bafdafc7046c12c /Timeline.Tests/Controllers/TokenControllerTest.cs | |
parent | 4ec507df6251bc1dae5204fdc6aaf14ddbb268f6 (diff) | |
download | timeline-40eea04e1ec9b71c5215e9dce5a6963ea60cafaa.tar.gz timeline-40eea04e1ec9b71c5215e9dce5a6963ea60cafaa.tar.bz2 timeline-40eea04e1ec9b71c5215e9dce5a6963ea60cafaa.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]
|