From 5e0ad225efd9627fa99509a1fdf3ed07672c8bda Mon Sep 17 00:00:00 2001 From: 杨宇千 Date: Fri, 9 Aug 2019 15:39:58 +0800 Subject: Add UserController unit tests. --- Timeline/Controllers/UserController.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Timeline/Controllers/UserController.cs') 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.")); } } -- cgit v1.2.3