public void DeletePostDeletesPost() { Guid postID = Guid.NewGuid(); FakePostService postService = new FakePostService(); FakeUserService userService = new FakeUserService(); postService.AddedPosts.Add(new Oxite.Models.Post() { ID = postID, State = Oxite.Models.EntityState.Normal }); MetaWeblogAPI service = new MetaWeblogAPI(postService, null, userService, null, null); bool ret = service.DeletePost(null, postID.ToString(), "test", "test", false); Assert.True(ret); Assert.Equal(1, postService.RemovedPosts.Count); Assert.Equal(postID, postService.RemovedPosts[0].ID); }
public void DeletePostFaultsForNullUser() { MetaWeblogAPI service = new MetaWeblogAPI(null, null, null, null, null); Assert.Throws <ArgumentException>(() => service.DeletePost(Guid.NewGuid().ToString(), null, null, null, false)); }