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
commit5e0ad225efd9627fa99509a1fdf3ed07672c8bda (patch)
tree26432b04bb7b2b2f59b3e8170f2e37cd5ce08c57 /Timeline/Controllers/UserController.cs
parentd3e8485bcd1070108299995d6335318dea6a1c22 (diff)
downloadtimeline-5e0ad225efd9627fa99509a1fdf3ed07672c8bda.tar.gz
timeline-5e0ad225efd9627fa99509a1fdf3ed07672c8bda.tar.bz2
timeline-5e0ad225efd9627fa99509a1fdf3ed07672c8bda.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."));
}
}