public void Post_NewBlogEntry_BlogEntryAddedToRepository() { var mockedRepository = new FakeReposiory(); var blogEntryController = CreateController(mockedRepository); var blogEntry = new BlogEntry { Title = "My new blogEntry" }; blogEntryController.Post(blogEntry); Assert.AreEqual(1, mockedRepository.Get().Count()); }
public void Post_NewBlogEntry_StatusCodeIsCreated() { var mockedRepository = new FakeReposiory(); var blogEntryController = CreateController(mockedRepository); var blogEntry = new BlogEntry { Title = "My new blogEntry" }; var response = blogEntryController.Post(blogEntry); Assert.AreEqual(HttpStatusCode.Created, response.StatusCode); }