aboutsummaryrefslogtreecommitdiff
path: root/Timeline/Controllers/UserController.cs
diff options
context:
space:
mode:
author杨宇千 <crupest@outlook.com>2019-08-09 15:39:58 +0800
committer杨宇千 <crupest@outlook.com>2019-08-09 15:39:58 +0800
commit58986da4a5bfe519af44e5834edfbe8d4651b51c (patch)
tree26432b04bb7b2b2f59b3e8170f2e37cd5ce08c57 /Timeline/Controllers/UserController.cs
parent6c50630c4d6576446fc2338714feaefbf28c4ed1 (diff)
downloadtimeline-58986da4a5bfe519af44e5834edfbe8d4651b51c.tar.gz
timeline-58986da4a5bfe519af44e5834edfbe8d4651b51c.tar.bz2
timeline-58986da4a5bfe519af44e5834edfbe8d4651b51c.zip
Add UserController unit tests.
Diffstat (limited to 'Timeline/Controllers/UserController.cs')
-rw-r--r--Timeline/Controllers/UserController.cs4
1 files changed, 2 insertions, 2 deletions
diff --git a/Timeline/Controllers/UserController.cs b/Timeline/Controllers/UserController.cs
index af4cfb53..6f2fe77f 100644
--- a/Timeline/Controllers/UserController.cs
+++ b/Timeline/Controllers/UserController.cs
@@ -14,7 +14,7 @@ namespace Timeline.Controllers
[ApiController]
public class UserController : Controller
{
- private static class ErrorCodes
+ public static class ErrorCodes
{
public const int Get_NotExist = -1001;
@@ -78,7 +78,7 @@ namespace Timeline.Controllers
catch (UserNotExistException e)
{
_logger.LogInformation(e, FormatLogMessage("Attempt to patch a non-existent user.", Pair("Username", username)));
- return BadRequest(new CommonResponse(ErrorCodes.Patch_NotExist , "The user does not exist."));
+ return NotFound(new CommonResponse(ErrorCodes.Patch_NotExist, "The user does not exist."));
}
}