public async Task <IActionResult> Create(string title, string content) { string userId = _userManager.GetUserId(User); HttpResponseMessage response = await PostEndpoints.CreatePost(userId, title, content); return(RedirectToAction("Index", "Post")); }
public void Post() { var response = PostEndpoints.CreatePost("admin", "UnitTest", "UnitTest").Result; Assert.IsTrue(response.StatusCode == System.Net.HttpStatusCode.Created); }