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"));
        }
Example #2
0
        public void Post()
        {
            var response = PostEndpoints.CreatePost("admin", "UnitTest", "UnitTest").Result;

            Assert.IsTrue(response.StatusCode == System.Net.HttpStatusCode.Created);
        }