public async Task GetCommentById() { var siteId = await MakeSite().ConfigureAwait(false); var firstPage = await MakePage(siteId).ConfigureAwait(false); var firstComment = MakeComment(); await PageRepository.SaveComment(firstPage.Id, firstComment).ConfigureAwait(false); var comment = await PageRepository.GetCommentById(firstComment.Id).ConfigureAwait(false); Assert.AreEqual(firstComment.Body, comment.Body); Assert.AreEqual(firstComment.Id, comment.Id); }
public async Task DeleteComment() { var siteId = await MakeSite().ConfigureAwait(false); var firstPage = await MakePage(siteId).ConfigureAwait(false); var firstComment = MakeComment(); await PageRepository.SaveComment(firstPage.Id, firstComment).ConfigureAwait(false); await PageRepository.DeleteComment(firstComment.Id).ConfigureAwait(false); var comment = await PageRepository.GetCommentById(firstComment.Id).ConfigureAwait(false); Assert.IsNull(comment); }
public async Task GetCommentById_RandomId() { var comment = await PageRepository.GetCommentById(Guid.NewGuid()).ConfigureAwait(false); Assert.IsNull(comment); }
public void GetCommentById_GuidEmpty() { var ex = Assert.ThrowsAsync <ArgumentOutOfRangeException>(() => PageRepository.GetCommentById(Guid.Empty)); Assert.AreEqual("Must not be Guid.Empty [Code 210110-1823] (Parameter 'commentId')", ex.Message); }