diff --git a/AsbCloudWebApi/Controllers/Mock.cs b/AsbCloudWebApi/Controllers/MockController.cs similarity index 60% rename from AsbCloudWebApi/Controllers/Mock.cs rename to AsbCloudWebApi/Controllers/MockController.cs index 910b1428..0c95725e 100644 --- a/AsbCloudWebApi/Controllers/Mock.cs +++ b/AsbCloudWebApi/Controllers/MockController.cs @@ -5,16 +5,19 @@ using System.Linq; namespace AsbCloudWebApi.Controllers { + /// + /// Имитирует разные типы ответа сервера + /// [Route("api/[controller]")] [ApiController] public class MockController : ControllerBase { /// - /// получить статистику + /// имитирует http-400 /// [HttpGet("400")] [ProducesResponseType(typeof(ValidationProblemDetails), (int)System.Net.HttpStatusCode.BadRequest)] - public IActionResult Get([FromQuery, Required]IDictionary args) + public IActionResult Get400([FromQuery, Required]IDictionary args) { var errors = new Dictionary(); @@ -38,5 +41,32 @@ namespace AsbCloudWebApi.Controllers return BadRequest(problem); } } + + /// + /// имитирует http-403 + /// + [HttpGet("403")] + public IActionResult Get403() + { + return Forbid(); + } + + /// + /// имитирует http-401 + /// + [HttpGet("401")] + public IActionResult Get401() + { + return Unauthorized(); + } + + /// + /// имитирует http-500 + /// + [HttpGet("500")] + public IActionResult Get500() + { + throw new System.Exception("Это тестовое исключение"); + } } }