public async Task <ActionResult> RemoveDirectory(string path) { try { UserHelper requestingUser = _controllerHelper.GetRequestingUser(this); await _directoryLogic.Delete(path, requestingUser); return(Ok()); } catch (UnprocessableException) { return(UnprocessableEntity()); } catch (UnauthorizedAccessException) { return(Unauthorized()); } catch (Exception e) { _logLogic.Log(e); return(StatusCode(StatusCodes.Status500InternalServerError)); } }
public void RemoveDirectoryUnprocessableExceptionTest() { Assert.ThrowsAsync <UnprocessableException>(() => _directoryLogic.Delete(null, new UserHelper())); }