public Core.Data.Models.Blog Add(Core.Data.Models.BlogItem item) { var blog = new BlogEngine.Core.Data.Models.Blog() { Id = Guid.NewGuid() }; return(blog); }
public void BlogControllerPost() { var newBlog = new Core.Data.Models.BlogItem(); var result = _ctrl.Post(newBlog); Assert.AreEqual(HttpStatusCode.Created, result.StatusCode); var json = result.Content.ReadAsStringAsync().Result; var blog = JsonConvert.DeserializeObject<Core.Data.Models.Blog>(json); Assert.IsNotNull(blog); Assert.IsTrue(blog.Id != Guid.Empty && blog.Id != null); }
public void BlogControllerPost() { var newBlog = new Core.Data.Models.BlogItem(); var result = _ctrl.Post(newBlog); Assert.AreEqual(HttpStatusCode.Created, result.StatusCode); var json = result.Content.ReadAsStringAsync().Result; var blog = JsonConvert.DeserializeObject <Core.Data.Models.Blog>(json); Assert.IsNotNull(blog); Assert.IsTrue(blog.Id != Guid.Empty && blog.Id != null); }